Verifying X Card Metadata and Forcing a Cache Refresh

Tatsuhiko Arai (新井 竜彦)

Tatsuhiko Arai (新井 竜彦)

· 4 min read
Just an image

What X Cards Are

When you paste a URL into X (formerly Twitter), the platform fetches the page and looks for specific <meta> tags to render a rich card — title, description, and image. Two overlapping tag sets are involved:

  • Open Graph (og:*) — the broader standard, also consumed by Facebook, LinkedIn, Slack, and others
  • Twitter Card (twitter:*) — X-specific tags that take precedence over OG when present

The key tags for image cards:

<meta property="og:image" content="https://example.com/image.jpg" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://example.com/image.jpg" />

twitter:card controls the card type. summary_large_image gives you the full-width image display. Without it, X renders a small thumbnail at best.

Verifying the Tags

The fastest way to confirm what a deployed page is actually serving is curl:

curl -s https://example.com/your-page | grep -i "twitter\|og:image"

This shows what the OG and Twitter Card tags look like to a plain HTTP client — the same view X's crawler has. Browser DevTools show the rendered DOM, which can diverge from server-rendered HTML. curl is unambiguous.

A correct response looks like this:

<meta property="og:image" content="https://cdn.example.com/photo.jpg?w=2000"/>
<meta name="twitter:card" content="summary_large_image"/>
<meta name="twitter:image" content="https://cdn.example.com/photo.jpg?w=2000"/>

If twitter:image is absent but og:image is present, X will usually fall back to it. If both are missing, no image appears regardless of what card type is set.

The Card Validator and Cache Refresh

X maintains a metadata cache for every URL it has seen. This cache can persist long after you've updated the page — redeploying the site does not flush it. The way to force a refresh is the Card Validator:

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

Submitting a URL there triggers an immediate re-crawl. The validator reads the current state of the page and updates X's cached metadata for that URL. This is a side effect of the tool rather than a documented guarantee, but it is well-established in practice and widely relied upon.

Preview Has Moved to Tweet Composer

As of 2024, the Card Validator no longer shows a visual card preview inline. The Preview tab was removed. For visual confirmation, open Tweet Composer and paste the URL into the compose box — X will render a live card preview using its (now-refreshed) cached data.

Announcement: https://devcommunity.x.com/t/card-validator-preview-removal/175006

The workflow is now two steps: validate (and flush cache) via the Validator, then visually confirm in Tweet Composer.

The Short Version

  1. Check og:image and twitter:image with curl | grep — this is what X's crawler sees.
  2. twitter:card: summary_large_image is required for the full-width image layout.
  3. The Card Validator at cards-dev.twitter.com/validator forces a cache re-crawl when you submit a URL.
  4. Visual preview is now in Tweet Composer, not the Validator.
  5. Already-posted tweets won't update — only new shares pick up the refreshed card.

A Few Things Worth Internalizing

  • X's metadata cache can outlive a redeploy by hours. The Card Validator re-crawl is the reliable way to evict it for a specific URL.
  • twitter:image takes precedence over og:image when both are present. Setting only og:image usually works, but explicit twitter:image removes ambiguity.
  • The image URL must be publicly accessible — no auth, no session token, no localhost. If it's behind access controls, X's crawler silently fails to fetch it.
  • Already-published posts are frozen: the card rendered at post time is the card they keep, regardless of later page changes.
Tatsuhiko Arai (新井 竜彦)

About Tatsuhiko Arai (新井 竜彦)

Embedded software engineer (Qt, C/C++, Python). Medical imaging (DICOM) contractor. AWS All Certifications Engineer – Japan (2024–2025).

Copyright © 2026 Tatsuhiko Arai. All rights reserved.
Made by Web3Templates· Github