How to Fix Twitter Cards Not Showing Images on WordPress Error

Are you having trouble with images not showing on Twitter when you share a link from your WordPress blog?

Your Twitter Cards aren’t working properly whenever your posts show up on Twitter like this:

I had the same error happen to me but it’s really easy to fix the problem.

Now my Twitter posts look like this:

In my case, I had a problem with my to robots.txt file on my root domain. This file allows or blocks access to your site folders whenever search spiders from Google, Twitter and other major sites want to index your content.

If you are accidently blocking the Twitterbot then your images won’t show correctly.

Here’s a step by step way to troubleshoot the problem:

Step 1 – Test your URL using the Twitter card validator

Twitter offers a Twitter card tool to preview your blog posts on Twitter. Type your URL into the tool and see what it looks like.

Step 2 – Add the following code to your Robots.txt file

If you get an error message mentioning your robots.txt file then add this code to your robots.txt on your root server:

User-agent: Twitterbot

Allow: /

This code allows the Twitterbot to access the images on your WordPress blog.

That’s it!

Check your URL again in the Twitter card validator to see if it works.

Hope this helps!

Subscribe to our newsletter and join our 43 subscribers.

Leave a Comment