• WordPress version: 3.4.2
    WordPress SEO version: 4.2.7

    I did this: Assigned a Featured Image to a post

    I expected the plugin to do this: Use ‘Thumbnail’ of the Featured Image as the og:image value (Default: 150 x 150 Cropped, changed to 200 x 200 Cropped)

    Instead it did this: Used ‘Medium’ of the Featured Image (300 x 300, not cropped).

    Now that that’s out of the way.
    By default, this plugin will use the Medium version of a post’s featured image. This is fine, but there is no option to tell it to use a) thumbnail (that can be set in Settings > Media) or b) a custom image size set up in the theme’s functions.php file. This would be a nice addition for a future release. In the meantime, to manually change to using ‘thumbnail’ or ‘my-custom-facebook-thumbnail’ sizes:

    Adjust ‘medium’ to the desired thumbnail size on line 155 of class-opengraph.php found under:
    frontend > class-opengraph.php

    From:

    $featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'medium' ) );

    To:

    $featured_img = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'thumbnail' ) );

    That is all.

    https://www.ads-software.com/extend/plugins/wordpress-seo/

Viewing 11 replies - 1 through 11 (of 11 total)
  • You just add a filter to your functions file to fix this rather than editing the plugin. Here’s the code I’m using.

    // Tell WP SEO to use a larger thumbnail
    function sc_opengraph_image_size($size="medium") {
    	return "full";
    }
    add_filter('wpseo_opengraph_image_size','sc_opengraph_image_size',10,1);
    Thread Starter Baden

    (@baden03)

    Yup, that’s way better.

    I’ve had a lot of issues with this. The fact that apply_filters is used in the plugin makes me assume Yoast plans to make this a setting. He really should because I’m having to fix this way too often.

    boborg

    (@boborg)

    I set the featured image 300×300 and then insert a thumbnail 150×150 of the same into the post.

    With WordPress Seo Social turned on I then get 2 meta property=’og:image’ entries. First the featured image and then the thumbnail 150×150.

    Including the function // Tell WP SEO to use a larger thumbnail there are still 2 og:image entries. Only difference is the file name has the 300×300 included in the filename without the function file fix.

    So is this how it is supposed to work?

    This post I made a while back includes some code that should fix it for you if you have a big enough image to work with. https://www.ads-software.com/support/topic/plugin-wordpress-seo-by-yoast-using-featured-images-thumbnail-for-facebooks-ogimage?replies=5#post-3607484

    the question I have is why not using the full picture as a default, Facebook is recommending 1500×1500 for those images now…

    I was looking all the net about this flaw, why the plugin show red dot when I only post with featured image? Thats mean Google not see my image too?

    Thanks a lot ryan! It works awesome.

    FB is currently changing their requirements for news feed images. I’d suggest to change default behaviour accordingly.

    https://developers.facebook.com/blog/post/2013/04/03/platform-updates–operation-developer-love/

    Minimum is 200×200 (so ppl don’t use thumbnail size!) and recommendation 600×600, so default “medium” 300×300 is a bit too small.

    I’d use “full” as default.

    I’ve started declaring a custom thumbnail size for this and using the filter method I mention in my previous comment,

    Perhaps Joost will address this in a future version. At least he put the filter there which helps us deal with this for now.

    Hi,

    i’ve set thumbnail size to 300×300 and i change line 254 in frontend > class-opengraph.php:

    from

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'large' ) );

    to

    $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), apply_filters( 'wpseo_opengraph_image_size', 'thumbnail' ) );

    unfortunately it’s does’t work…

    where i must add function:

    // Tell WP SEO to use a larger thumbnail
    function sc_opengraph_image_size($size="medium") {
    	return "full";
    }
    add_filter('wpseo_opengraph_image_size','sc_opengraph_image_size',10,1);

    ?

    I have WP 3.5.1, and WordPress SEO 1.4.7

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Using Featured Image's Thumbnail for Facebook's og:image’ is closed to new replies.