Hello!
Which images does TSF take that aren’t appropriate? Do you have an example (link)?
Its ‘AI’ only went through one manual iteration thus far; it’s currently able to avoid including form button images, tracking pixels, scripts, etc. We may, with some help (and data!), improve it further 🙂
In any case, you can exclude images by filtering the found image details. It requires some PHP knowledge to configure it well. This snippet should help you get started:
add_filter( 'the_seo_framework_image_details', function( $details ) {
foreach ( $details as $i => $detail ) {
// Exclude by URL-part.
if ( false !== strpos( $detail['url'], 'exclude-this-image.jpg' ) ) {
unset( $details[ $i ] );
}
// Exclude by ID.
if ( 42 === $detail['id'] ) {
unset( $details[ $i ] );
}
}
return $details;
} );
Thanks for your response and your snippet! I think I’ll be able to use it to accomplish what I want.
The image in question that would sometimes be chosen was an icon in PNG format with transparent background. (https://dev.rhinehartphotography.com/wp-content/uploads/2020/10/rotatephone-white.png) I assume sometimes people would want images with transparent backgrounds to be selected, but in my instance it wasn’t the best choice available on the page.
Thanks for that! I just took a peek at the site, and I’m not sure if we can find a way programmatically to exclude such an image without affecting performance… unless we add more toggles, are able to read content-images metadata, and inspect their sizes.
All these things are planned for future releases, but we’re not quite there yet. I hope the filter suffices until then! Cheers 🙂