Like many long-time bloggers, I update older posts regularly with new content, adding new info as well as resources and a new featured image to draw interest to the updated post.
For example, for my How to Find the Original Source for an Image post, I knew some of the content was outdated.
I wanted a fresher look for the post, so I created a new featured image and updated the content.
Before I published the changes, I checked the featured image for the post to confirm it was configured with the new image.
It was.
So I went ahead and published my post.
But when I shared my updated post on Twitter later that day, the old featured image displayed on my Tweet.
What happened?
Why wasn’t my new featured image displayed on Twitter?
I quickly switched into troubleshooting mode to figure out what was going on.
If you run into this issue when you tweet a link, here’s how you can resolve it.
How Twitter Determines Which Image to Display
Twitter relies on Twitter Cards to display an image.
Twitter Cards allow you to display an image, title, and description when you share a link on Twitter, rather than only the link.
Your site needs to support Twitter Cards in order for an image to display.
In WordPress, there are multiple ways to do that. Here are three methods:
- Yoast SEO plugin, in the Twitter tab of their Social section (how to set up Twitter Cards in Yoast SEO)
- As of Jetpack 8.5 (released in May 2020), the Jetpack plugin no longer adds the featured image to tweets, it only does Twitter cards. There is no setup needed in Jetpack for Twitter cards.
- Add a filter to your theme’s functions.php file
I knew Twitter Cards were working on my pages and posts since I regularly tweet links and the appropriate featured images display.
What could be causing the problem?
Twitter Image Requirements
I researched online and discovered Twitter has specific image requirements:
- Minimum dimension of 300 pixels x 157 pixels
- Maximum dimension of 4096 pixels x 4096 pixels
- Less than 5MB in size
- JPG, PNG, WEBP, and GIF format
- SVG is not supported
I checked my image and confirmed it met all of the Twitter card image requirements.
That’s when I learned Twitter follows a similar policy to how Facebook confirms what image to display for a post.
Twitter Card Validator
Similar to how the Facebook Debugger works, the Twitter Card Validator allows you to confirm which image Twitter will display before you tweet your link.
I have to say, I don’t recall using it except possibly when I first set up Twitter Cards years ago.
You enter the URL and Twitter fetches the page to display what the card will look like.
When I ran it with the link I shared this morning, it displayed the correct image.
Hmmm. What was I missing?
What You Need to Know about the Twitter Card Validator
And that’s when I discovered three things about the Twitter Card Validator:
- You have to be logged into your Twitter account to use it
- It can be problematic. When the wrong image displays, refresh your page (just like the Facebook Debugger).
- If you’ve tweeted the link in the past, you’ll want to validate the URL to clear Twitter’s cache
In my case, it was the third item causing the incorrect image to display.
Somehow Twitter’s cache picked up the image from an earlier tweet.
Because without me making any changes to the post, I looked again at the tweet published earlier with the incorrect image.
How to Find the Original Source of an Image https://t.co/Ez2nWSTvVV
— Deborah Edwards-Onoro (@redcrew) June 13, 2018
The correct image displayed in the Twitter stream!
Success!
But I now know before I share a post with a new featured image, I need to confirm the correct image displays with the Twitter Card Validator.
Summary
You might always get the correct image to display in a tweet when you share your links on Twitter.
Know that if you change a featured image in WordPress, it’s possible an incorrect image will display on Twitter.
Confirm your Twitter Cards are set up correctly, your image meets Twitter Cards requirements, and use the Twitter Cards Validator to confirm the correct image displays.
What methods do you use to troubleshoot Twitter displaying the correct image for posts? Share your recommendations in the comments.
Originally published June 13, 2018. Updated with details about Jetpack and Yoast SEO methods for Twitter Cards.