The Facebook has a max og:image size of 8MB: https://developers.facebook.com/docs/sharing/best-practices#images
The Twitter has a max twitter:image size of 1MB for Summary cards: https://dev.twitter.com/cards/types/summary
The plugin returns the full size featured image when there is no image assigned to the Meta box -> Social option or globally from the Yoast SEO -> Social options. When you use a larger image for the featured image which is more than 8MB, most of the themes never output the full-size image, but the plugin is sending the full image size to the Twitter and Facebook instead of using the smaller one.
It would be nice, especially in the premium version, to be able to choose an image size to send to Facebook, Twitter, and Pinterest. I know you can choose specific social images for individual posts, but this would be a way of ensuring by default that images are within guidelines. Or you could change the plugin's image_thumbnail_output() to check for file size using filesize().
The user from the conversation # 162487 shared a temporary solution with us:
The large image size is likely to be below 1MB in the majority of cases, thereby fitting both Facebook and Twitter's guidelines.
function tend_custom_twitter_image_size( $img_size ) {
return 'large';
}
add_filter( 'wpseo_twitter_image_size', 'tend_custom_twitter_image_size');
add_filter( 'wpseo_opengraph_image_size', 'tend_custom_twitter_image_size' );
Please inform the customer of conversation # 162487 when this conversation has been closed.
That's alright, the customer will keep an eye on this PR ;)
In 7.4 (which is scheduled for next Tuesday) we have created the option to check the image size. If an image is bigger than 2mb, there's a check to see if there's an attachment available that is smaller than 2mb. If that is the case, that image will be added to the open graph on the frontend.
If that is not available either and the image is bigger than 2mb, the image will be removed from the opengraph settings.
More information can be found in this pull request: https://github.com/Yoast/wordpress-seo/pull/9418
@CarolineGeven I see there's more being done than just #9418 - lots of image data is being checked according to #9370.
Is there a way to programatically force the option to check the image size, rather than having to set that option on every site?
Thanks for addressing this BTW!
@mattradford Yes, we're quite busy currently with open graph functionality.
What do you mean with
Is there a way to programatically force the option to check the image size, rather than having to set that option on every site?
Could you please elaborate?
@CarolineGeven Sure:
In 7.4 (which is scheduled for next Tuesday) we have created the option to check the image size.
Is there a filter available to enable this option, i.e. one I can drop into a file in a theme or plugin, or do I have to go into wp-admin and check a box?
@mattradford This option will be enabled by default, as we follow best practices for open graph, so there's nothing you need to do on your end.
Hey Yoast team,
Im a little late to the race, but considering that uploading humungous images is the trend due to @2x, Maybe it is a good idea to add custom yoast size image creation to the plugin, and then either wen selecting an image, or automagically adding an image configure yoast to pick the ideal size.
It would just be adding imagesizes for all different platforms, with a function to wp, hit regenerating thumbnails.
Adding the new imagesizes as yoast defaults.
Nice2have selecting images via WP media browser if we want to choose manual.
That way our 4K ft images are suddenly usable everywhere.
Cheers!