Wrong image showing on Facebook when you share a link?
In an ideal world, when you share a WordPress link to Facebook, we’d hope that Facebook would pull in the WordPress featured image and use that as the image that shows for folks who see the link on Facebook.
For a variety of reasons, that doesn’t always happen. Here’s how to get the WordPress Featured Image on Facebook.
A Quick Technical Background: Open Graph Data
To understand why Facebook sometimes doesn’t show the image we want, let’s understand how Facebook knows what image to show. Facebook uses something called Open Graph Meta Tags – a special set of tags that are part of a webpage – to control what image, title, description, and other metatadata are shown when a page is shared to Facebook. These tags and information aren’t seen by your website visitors, but rather they live behind the scenes on your website.
If you want all the nitty-gritty details, here’s the Facebook developer documentation. Thankfully, you don’t need to read that unless you’re curious.
In order for Facebook to use the image we want, there need to be open graph tags that tell Facebook which image to use.
Getting Open Graph Tags onto your WordPress Website
Some (most?) modern WordPress themes will include code that automatically adds the Open Graph tags so that your WordPress Featured Image gets used when you share a post on Facebook. If your theme doesn’t include this code, you can use a WordPress plugin to handle it. Here are a couple options, including one you might already have and not realize…
Adding Open Graph Tags with Yoast SEO
I heartily recommend the Yoast SEO plugin for its great SEO abilities, but it can also handle managing the Open Graph tags. These features are part of the free plugin and don’t require a premium account. After installing Yoast SEO, I recommend going through the setup wizard to get things configured. Then you can enable having Yoast set the Open Graph tags for your site.
Go to SEO->Social, go to the Facebook tab, and ensure that “Add Open Graph meta data” is set to Enabled
That’s it – your Featured Image should now show as your Facebook sharing image.
Adding Open Graph Tags with Facebook Thumb Fixer
If you’re already handling your technical SEO with something other than Yoast and want a plugin that only adds the Open Graph tags, I recommend Facebook Thumb Fixer. It will ensure that your Featured Image gets shared as the Open Graph image, and thus it will show on Facebook.
What if Facebook is Showing the Wrong Image?
Sometimes Facebook might grab the wrong image, perhaps because the post was shared before you implemented Open Graph tagging, or perhaps because of another technical glitch. If this is the case, you can tell Facebook to re-scrape your post and hopefully get the right image. I wrote about that previously: