If you didn’t use Jetpack publicize to automatically publicize to Facebook, but you now want to share your content on Facebook using a Share this: button, then you might find that the image that Facebook chooses is not your preferred image.
Here are some steps that might help you to get Facebook to choose the right image.
- Enable Facebook Open Graph capability
- Enable Featured images
- Select a suitable image
- Clear the Facebook cache for the URL
Enable Facebook Open Graph capability
A number of plugins provide support for Open Graph capability, including Jetpack and WordPress SEO.
You can check to see if the tags are being created by:
- Viewing your page
View page sourceor your browser’s equivalent to view the source of the page
- Search for
You’re hoping to see something like this.
<meta property="og:image" content="http://www.oik-plugins.com/wp-content/uploads/2014/11/Share-to-Facebook.jpg" />
og:image is present but the image is not the one that Facebook is using then you will need to clear the Facebook cache for the URL.
Note: If you’re using Jetpack Publicize or Sharing, then you should see a number of Open Graph meta tags.
If you’re also using WordPress SEO and have checked
Add Open Graph meta data ( SEO > Social > Facebook ) then you will see that the tags have actually been created by WordPress SEO.
Enable Featured images
Both Jetpack and WordPress SEO will use your featured image to create the Facebook Open Graph data.
If there are some
property=og: tags but not the
og:image one then it would suggest that you have not defined a Featured image.
If your post type does not support Featured images then you can use the oik-types plugin so that it does.
Select a suitable image
The image that you define as your featured image should be:
- At least 200px by 200px
- Accessible from Facebook. e.g. Publicly available to site visitors and not password protected
- It used to be that it should have an aspect ratio not greater than 3:1
Clear the Facebook cache for the URL
If you change the post or page so that the image that Facebook should use now different from the one that it cached when it first scraped the URL, you can attempt to override this behaviour by clearing Facebook’s cache.
- Open the Facebook debugger
- Paste in the full URL of the content to be shared. Don’t use a shortlink, they don’t work.
- Click on the Debug button.
- The Open Graph Object Debugger will show you the image that will be used
If Facebook can’t find an appropriate image it tells you.
Messages you might see include:
The ‘og:image’ property should be explicitly provided, even if a value can be inferred from other tags.
og:image was not defined, could not be downloaded or was not big enough. Please define a chosen image using the og:image metatag, and use an image that’s at least 200x200px and is accessible from Facebook. Image ‘http://www.oik-plugins.com/wp-content/uploads/2012/11/oik-shortcode-server-banner-772×2501.jpg’ will be used instead.
If you get the second message you might just want to try again.
When you see the right image then you should check that What You Can See Is What You Want. You may find that it has cropped the image so that it doesn’t display correctly. If that’s the case you might want to crop the image yourself and try again.