Twitter Card Validator: how to test X previews now

·4 min read

The Twitter Card Validator no longer previews cards. X removed the preview in mid 2022, and its developer team now tells you to test a card by pasting the URL into the post composer on X's website or app. The old address, cards-dev.twitter.com/validator, now redirects to an X login page. To test a twitter card today, check that your tags are in the raw HTML Twitterbot receives, then paste the link into a draft post and look at the card before you publish.

What happened to the Twitter card validator?

X took the preview out of the Card Validator because the previews did not match what people saw in the real apps. That explanation comes from the pinned "read this first" post in X's developer forum, Card error, unable to render, or no image, maintained by the XDevelopers account. It says that "as of mid 2022" the preview is gone and recommends pasting your URL into a composer instead.

The same post adds two details worth knowing before you debug. Cards are not served through the API, so third-party X clients may not show them. And since early 2022, App cards render as summary cards.

I could not find any current X document that says what the validator page still does after you log in, so do not plan around it. Treat the composer as the official preview and do the rest of the checking yourself.

How to test a Twitter card on X today

Testing an X card takes four checks, and the first three catch most problems before you ever open X.

  1. Fetch the page as Twitterbot. X's forum post suggests this exact command. Confirm the response is a 200, has a valid Content-Type header and contains your twitter:card tag in the <head>.

    curl -v -A Twitterbot https://www.example.com/blog/post
  2. Check that the tags are static. The same post says the crawler cannot run JavaScript, so tags added by a framework or Google Tag Manager after load do not exist for X. If view-source does not show them, X does not see them. Our JavaScript SEO guide covers the server rendering fix.

  3. Check robots.txt for the page and the image. X's getting started guide says Twitterbot follows robots.txt. A blocked page shows no card, and a blocked image shows no picture. If your images live on a CDN domain, that domain's robots.txt counts too.

  4. Paste the URL into the composer. Start a new post on x.com or in the app, paste the link and wait for the card to appear. Delete the draft if you are only testing.

If step 4 shows a plain link while steps 1 to 3 pass, check the image. X's markup reference says card images must be under 5MB, in JPG, PNG, WEBP or GIF, and SVG is not supported. Use an absolute https URL. Our post on why an og:image is not showing walks through the other image failures.

The twitter card tags and their og: fallbacks

X reads its own twitter: tags first and falls back to Open Graph for the rest, so most pages need only one X tag. The markup reference lists these pairs.

X tag Falls back to Limit in X's reference
twitter:card og:type, may give a summary card summary, summary_large_image, app or player
twitter:title og:title 70 characters
twitter:description og:description 200 characters
twitter:image og:image Under 5MB, no SVG
twitter:image:alt og:image:alt 420 characters

The row that matters is the first one. Without twitter:card, X "may" render a summary card, which is the small square thumbnail. For the wide image card, set it yourself.

<meta name="twitter:card" content="summary_large_image">

Add twitter:title or twitter:image only when you want X to show something different from LinkedIn and Facebook. The full Open Graph block, and why og tags use property= while twitter tags use name=, is in our guide to Open Graph tags.

Why X shows an old card after you fix the tags

X shows an old card because it cached the first version it fetched. X's getting started guide said X caches card content for 7 days after a link with card markup is posted. X's current docs describe no way to force a refresh.

You have three options.

  1. Wait out the cache. For a page you will share again next week, this is the honest fix.
  2. Share a new URL. A link with a harmless query string, such as ?v=2, is a URL X has not fetched, so it builds a fresh card. Keep og:url and your canonical tag pointing at the clean address so search engines and share counts stay on one URL.
  3. Rename the image file. If only the picture is stale, upload it under a new file name and update the tags, so no cache holds the new image URL yet.

Check the page before the first share, not after. Comparing how one URL looks across X, LinkedIn and Facebook is the subject of our Open Graph preview guide.

Check your X card before you post

Our Open Graph checker fetches one URL and lists every og: and twitter: tag in its head, shows which tag each part of the card came from, and previews the card. It flags a missing or unknown twitter:card, relative or plain http image URLs and conflicting duplicate tags. It downloads the share image, plus twitter:image when that is a different file, and checks format, file size and dimensions against each platform's limits, including X's 5 MB cap.

Each run costs 5 credits. It reads the HTML as served, so it does not see tags JavaScript adds after load, and it cannot refresh X's cached card.

Keep reading