Search code examples
facebookimagefacebook-social-plugins

Post image missing when pasting link into Facebook despite the correct og:image meta tag


Within head tags of this post page (sorry there's a language selection prompt screen), Yoast SEO Plugin generates this:

<meta content="http://www.example.com/wp-content/uploads/2015/06/whatever.jpg" property="og:image">

Although the image linked here is Facebook compliant (above 200x200px), there's still no image appearing when pasting the post link into Facebook. My question is: why?

Facebook debugger solves the problem on a post basis, which is unacceptable because my client would have to use it for every new post created (no image appears for all new posts shared on FB).

I can make it work to some degree using this comment's code:

add_filter( 'wpseo_og_og_image', function ( $content ) { return $content . '?scrape=true'; } );

But it only works after pasting an URL at least three separate times in FB with page refresh between each time, so still no acceptable.


Solution

  • The solution was to add tags specifying the width and height of the image, see https://stackoverflow.com/a/27913458/871404