Setting Custom Social Media Images with Yoast

The Blog

Setting Custom Social Media Images with Yoast

Update: In 2023, Yoast moved the ability to set a page-specific image to only be possible using its Yoast Professional plugin. If you need to set the social image on a specific page, you will need to purchase the plugin at $100 a year.

WordPress usually does a good job of selecting the correct image from your posts to share on Facebook, Twitter and LinkedIn. But what if you want to set a default image for your entire site or customize the shared image for a specific post? This is very easy using the free WordPress SEO plugin Yoast.

Setting a Default Social Media Image

It’s always a good idea to set a default social media image for pages that don’t have a set featured image or do have an image that doesn’t get pulled in by social media pages because of placement or size. This default image is usually a high-quality version of your companies logo, but could also be a custom image created for this purpose.

  1. To get started, hover over the SEO item in your sites left-hand navigation and select Social.Step 1: Setting Up Social Media Sharing
  2. Click the Facebook tabStep 2: Setting Up Facebook
  3. Make sure the “Add Open Graph” meta data slider is set to Enabled
  4. Press the Select image button and either upload a new image or select an existing image from your media library
  5. Press the Save changes button
  6. Select the Twitter tab
  7. Make sure that the “Add Twitter card meta data” slider is set to enabled
  8. Press the Save changes button

Setting a Social Media Image for a Specific Page

Sometimes a post or page either doesn’t have a suitable image for social media sharing or you would like to use a different image on social media than what is on the page itself. The Yoast plugin also makes this very easy.

  1. Find the Yoast SEO section of the page or post you are editing. It is generally at the bottom of the page.Step 1: Setting a Default Image
  2. Select the social tabStep 2: Setup Facebook
  3. Press the Select image button and then either upload the custom image you want to use or select an image from your media library.
  4. (Optional) Customize the Facebook post title and description.
  5. Scroll down to the twitter sectionStep 3: Setup Twitter
  6. Press the Select image button and then either upload the custom image you want to use or select an image from your media library.
  7. (Optional) Customize the Twitter post title and description.
  8. Publish or update the page or post you are editing.

Troubleshooting Social Media Share Issues

If after setting your default or custom social media image you still don’t see it when you share to Facebook or Twitter, it is possible the old image may be cached.

Clearing the Facebook Cache

To fix this issue for Facebook, you can use the Facebook Sharing Debugger.

Facebook Sharing Debugger

  1. Enter the URL of the page or post from your site that you just updated in the box at the top of the page.
  2. If the image on the resulting page is not the image you were expecting, hit the scrape again button and Facebook will try again.
  3. If you are still not seeing the correct image, you may need to clear your websites cache (or wait 10-15 minutes and try again).

Clearing the Twitter Cache

Although Twitter’s Card Validator page still exists, it no longer allows you to update or view your social images. Twitter has not implemented a new way to do this, instead, you just need to wait for their crawler to visit your page, which will then update it. According to Twitter, it should visit sites in its index about once a week.

Clearing the LinkedIn Cache

LinkedIn’s Post Inspector can be used to clear your social images on LinkedIn. It’s a very simple process where you just paste in your URL and LinkedIn will automatically update the info from your post and show you the results.