Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Default Setting for Social Image doesn't work

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Joost de Valk


    How is it not working? Please describe what you’re doing, what you’re expecting the plugin to do and what it does instead.

    I have set this values,

    Frontpage settings
    Image URL:
    Description: The Supreme Point of Complexity and Consciousness

    Default settings
    Image URL:

    The Frontpage settings Result :
    It’s working greatly. The Image is showing.


    The Default Settings Result :
    Here, The image is not showing.

    I can confirm the bug report. I suggest adding the following code or similar at line 241 of /frontent/class-opengraph.php:

    if ( !count($shown_images) && isset( $this->options['og_default_image'] ) )
    $og_image = $this->options['og_default_image'];

    $og_image = apply_filters( 'wpseo_opengraph_image', $og_image );

    if ( isset( $og_image ) && $og_image != '' )
    echo "<meta property='og:image' content='".esc_attr( $og_image )."'/>\n";

    This is basically just a copy of the snippet from the is_singular() else case immediately below. I think this was what was intended here but was omitted in oversight.

    Won’t there be any official solution for this on next updated version?

    Plugin Author Joost de Valk


    Ugh. Seriously, one more time: please read this thread and follow the instructions there. If the issue persists, try to formulate your problem using the template in that post. I can’t do anything based on what you’re telling me here.

    Hi Joost, sorry for any confusion though I am not the OP…

    WordPress version: 3.4
    WordPress SEO version: 1.2.2

    I did this:

    (1) I created a page without a Featured Image set using a theme which supports Featured Images. The page does not contain an <img> in the content body.
    (2) Under SEO > Social, I set the value for a default image under “Default settings / Image URL.”

    I expected the plugin to do this:

    When viewing the page, I expected to see an “og:image” meta tag in <head> with the URL that I specified for the default image.

    Instead it did this:

    No “og:image” meta tag appears in the page output.

    What I recommend:

    As I attempted to explain above, you are missing any consideration of the default image setting un frontend/class-opengraph.php. For the is_singular() case, you check:

    (a) if this is the front page,
    (b) if the post/page has a thumbnail, and
    (c) if the post/page contains an <img>.

    What’s missing is a step d where, failing cases a-c, you check whether there is a default image URL specified in options and display that as the og:image. There is a code block for the is_singular() else case (lines 251-257) which I adapted slightly in my sample fix three messages up from this one.

    Plugin Author Joost de Valk


    Ah. Ok, i finally get it, sorry for being daft. It should be fixed in the development version, could you please veriyf? You can download the development version from here, or you can download it directly here.

    Yes, that’s perfect — thanks for all you do! 🙂

    Plugin Author Joost de Valk


    Awesome. Ok, closing this thread.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Default Setting for Social Image doesn't work’ is closed to new replies.