Preview image not displaying on Twitter


#1

I recently noticed that Twitter is not showing any image previews for our Curatescape site. Even if we didn’t have any images attached to a story, I believe it is supposed to fall back on the logo file so I’m guessing that Twitter has changed something! I confirmed that this issue is present in Explore Baltimore Heritage and Cleveland Historical and appears using both Chrome and Firefox.

Here is an example of how an Explore Baltimore Heritage link appears on Twitter:

05%20AM

Here is an example of how a Cleveland Historical link appears on Twitter:

34%20AM

Image previews still appear to be working just fine on Facebook. Thanks in advance for help in trouble-shooting this issue.


#2

Hi @pousson I think maybe it has to do with the robots.txt file. I tested the links and here’s what the twitter card validator returns for both of our sites…

INFO:  Page fetched successfully
INFO:  18 metatags were found
INFO:  twitter:card = summary_large_image tag found
INFO:  Card loaded successfully
WARN:  The image URL https://explore.baltimoreheritage.org/files/fullsize
/f5581a9c0037835ce65d2f63c4ea257b.jpg specified by the 'twitter:image' 
metatag may be restricted by the site's robots.txt file, which will prevent 
Twitter from fetching it.

I updated my robots.txt file, whitelisting Twitterbot above any other rules.

User-agent: Twitterbot
Disallow:

See https://developer.twitter.com/en/docs/tweets/optimize-with-cards/guides/getting-started

It appears that this fixes the issue after about 10-20 minutes, though some URLS that have been recently cached may not be re-indexed for up to a week.


#3

PS: this is the default robots.txt file for Omeka.

User-agent: *
Disallow: /files/

This blocks access to the image used in the card.

Depending on your upgrade process, you may need to update robots.txt after each version update.


#4

I think that fixed the issue for me! Thanks for the quick response.