65

Literally I am looking for something like this:

https://developers.facebook.com/tools/debug/

But for Twitter Cards.

I put something wrong on my pages and I need them to be refreshed asap. But after google I only found this post:

https://dev.twitter.com/cards/troubleshooting

It seems Twitter only offers a weekly update. Is there any manual way to purge the wrongly cached pages?

Thanks

AGamePlayer
  • 7,404
  • 19
  • 62
  • 119

9 Answers9

98

I just managed to force it to update mine:

https://cards-dev.twitter.com/validator

In validating it updates its cache.

John Connor
  • 1,044
  • 9
  • 3
  • 32
    This doesn't seem to work anymore. I recently switched from the "summary" card to "summary_large_image" yet the validator still reports that I'm using the former. I'm also getting spurious whitelist warnings for older blog posts. – Bower Aug 18 '16 at 11:15
  • 2
    It didn't bust the cache for me. – ericso Oct 17 '16 at 20:58
  • 1
    Worked for me, and THANKS! – Nello Jun 22 '17 at 23:41
  • 3
    This is a misleading answer - since validator doesn't bust the cache – Patrik Beck Aug 25 '17 at 12:00
  • 11
    It worked for me after validating twice. The first didn't do anything, but the second time busted the cache. – kichik Aug 31 '17 at 19:58
  • 1
    It should be noted, the validator indeed clears the card cache itself, but not clears the embedded player cache for the link. So, for example, if you share a video on Twitter via cards and you change something in the design of the embedded player it will take effect only on newly shared videos even if you purge the cache via the validator. – Gabor Garami Apr 14 '19 at 20:36
  • They deprecated the Cards Validator in 2023. What's the solution now? – Paul Razvan Berg Jul 10 '23 at 15:08
27

There's actually a simpler solution than what is proposed by Twitter:

  • Go to https://cards-dev.twitter.com/validator
  • Type in the URL you want to update, BUT with a change. For example, add ?utm_source=Whatever
  • Then just reloaded page with whatever tweet had your Twitter card

When Twitter validator encounters this different URL, it clears its cache and fetches the new version.

Vic Seedoubleyew
  • 9,888
  • 6
  • 55
  • 76
  • Works for me, thanks! Also looks like there's some client side cache: have to refresh browser page for getting a new metadata while writing a new tweet – Adamovskiy Jul 19 '22 at 15:23
19

Following the steps in Twitter Card's Troubleshooting Guide actually forced the cache to clear in my case.

When testing and/or iterating on Cards, it is sometimes helpful to test updates on your timeline. It may be possible to use the following technique to refresh the cache with your most up-to-date changes of your page’s Card.

  1. Add Card metadata to a page
  2. Tweet URL to that page
  3. Refresh your browser to view the Card contents on your timeline
  4. Change Card metadata on the page
  5. Take the same URL and runs it through bit.ly
  6. Tweet the new bit.ly URL
  7. Refresh your browser to view the updates

Additionally, you can create multiple bit.ly URLs to allow for repeat testing.

I generated a bit.ly link to the page, then tweeted it, and then quickly deleted that tweet. It cleared the cache right away for the other tweet.

Pat Migliaccio
  • 1,031
  • 13
  • 24
  • If it's just caching that your robots.txt is disallowing everything, all I had to do was 1) change robots.txt 2) tweet a link with twitter meta data 3) refresh twitter and maybe visit the individual tweet url. Now https://cards-dev.twitter.com/validator sees everything correctly. I didn't need to use bit.ly for anything. – squarecandy May 11 '17 at 22:59
  • Did try it... Validator shows OK, 15 minutes later still old preview: https://twitter.com/Astralship1/status/895342579801313282 – Mars Robertson Aug 09 '17 at 18:06
9

I ran across the same problem.

I needed to update a cached summary_large_image and the

Twitter Card Validator (https://cards-dev.twitter.com/validator)

was showing zero interest in wanting to update the previously cached image.

I fixed it by ensuring that every time Twitter fetches the page, the image URI updates to something Twitter has never seen or cached before.

This is as simple as deploying the uniqid() function in PHP and using that as the query at the end of the image URI.

e.g.

<?php

echo '
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="http://example.com/my-twitter-image.png?'.uniqid().'">
';

?>

Since the image URI is different every time Twitter goes to fetch it, this forces the cache to update.

Rounin
  • 27,134
  • 9
  • 83
  • 108
4

There is a very simply way to force a cache invalidation of the Twitter Card bot.

If you are composing a tweet with an URL like https://example.com you only have to append a /# to the URL like so: https://example.com/# and it will immediatly fetch the updated metadata.

Niels
  • 479
  • 3
  • 4
1

The only thing that helped me clear the cache was adding ?v1 to the end of the image URL:

<meta property="twitter:image" content="https://website.com/img/twitter.jpeg?v1" />
Andrew Savetchuk
  • 1,552
  • 1
  • 16
  • 21
0

Haven't validated this approach but encountered this error twice and these steps seemed to force the update of the 'summary card':

  1. tweet link only (removing incorrect summary card from tweet composer)
  2. delete the tweet that shows the link only
  3. refresh twitter
  4. compose new tweet, pasting your link - should show updated/correct card image, title and subscription.
richfind
  • 13
  • 3
0

Got to http://debug.iframely.com

Copy and past your url then click on the right side button. Example: Before was Tweet URL: https://bdprescription.com/entertainment/details/article/21/Full-Stack-PHP-Laravel-Vuejs-and-Angular-Developer/

Next update URL like this https://bdprescription.com/entertainment/details/article/21/Full-Stack-PHP-Laravel-Vuejs-and-Angular-Developer?(add unique number)

Add unique any number or string last position of url, which was not given before. "?(add unique number)" Then tweet new url

0

I have discussed this in detail at Jekyll: Twitter Card Image Caching The method I used is:

  • I was building and publishing a blog site built using Jekyll
  • Change the name of the post and hence to slightly change the URL.
David Jones
  • 542
  • 4
  • 13