Skip to main content
SEO Auditor — validates the X (Twitter) Card meta tags so links shared on X render a proper preview.

Social sharing

X builds the card shown under a shared link from the twitter:* meta tags of the page.

Click-through

A card type, title and reachable image make shared links stand out in the timeline and get clicked.
The X (Twitter) Cards markup reference describes the <meta name="twitter:…"> tags X reads when a link is posted. This auditor fetches the page, collects every twitter: meta tag, verifies the two tags every card needs (twitter:card and twitter:title), checks the card type and the tags each card type depends on, checks that twitter:url and twitter:image are absolute and consistent with the page, and probes the twitter:image URL once to confirm it serves a supported image type.

How it works

  1. Fetch — requests the HTML through the core HTTP fetcher (including HTTP Basic Auth when provided). A blocked request (HTTP 403, 429 or a Cloudflare challenge) ends with 37A-TwitterCardAuditor-590; any other fetch failure produces an ERROR response with 37A-TwitterCardAuditor-500.
  2. Collect — reads every <meta> whose name (or property) starts with twitter:, keeping document order and repeated values.
  3. Probe — when twitter:image is an absolute URL, sends one HEAD request (falling back to GET on 405) and records the HTTP status and Content-Type; both image rules read that single answer.
  4. Rules — a missing or blank twitter:card or twitter:title is a FAIL. Empty optional tags, duplicated tags, unknown twitter: tags, an unsupported card type, relative or off-host URLs, card types without the tags they need, an image without alt text, and an unreachable or non-image twitter:image are WARNINGs.
  5. Aggregate — ERROR wins, then FAIL, then WARNING; if every rule passes, the audit is SUCCESS.
  6. Specification pin — every run emits 37A-TwitterCardAuditor-100 (INFORMATION) naming the X Cards markup reference. That check does not change overall status.

What it audits

Every row maps to one checkRule* method and one CheckCode. 37A-TwitterCardAuditor-100 is emitted on every run, including fetch errors. Image rules 312 and 313 only run when twitter:image is absolute, and 313 is skipped when 312 fires. Card type comparisons ignore case. CheckCode suffixes use status ranges: 100 information, 200 success, 300–399 warning, 400–499 fail, 500–599 error.

Output documentation

Risks and considerations

Required tags

  • twitter:card selects the layout and twitter:title is the headline; without either, X shows a bare link. X falls back to og:title, og:description and og:image for the other fields, but not for the card type.
  • A required tag with an empty content is as bad as a missing one and is harder to spot in a template, so it fails rather than warns.

Card types

  • Only summary, summary_large_image, app and player render; photo, gallery and product cards were retired and now produce no preview.
  • A summary_large_image card needs twitter:image; a player card needs twitter:player with twitter:player:width and twitter:player:height; an app card needs at least one twitter:app:name:* platform.
  • Comparisons of the card type ignore case, so Summary passes 303 but is still worth normalising.

URLs and the preview image

  • twitter:url is not part of the current markup reference but is widely used; when present it should be the canonical absolute URL on the page host, otherwise the card is attributed to another address.
  • twitter:image must be an absolute, publicly fetchable URL served as JPEG, PNG, GIF or WebP (SVG is not rendered). A 403, 404 or timeout leaves the card without a picture.
  • The auditor probes with HEAD first and retries with GET on 405; servers that reject HEAD with other status codes will warn under 312.
  • twitter:image:alt (up to 420 characters) is read by screen readers; it is a warning, not a failure, because the card still renders without it.

Repeated, empty and unknown tags

  • X uses the first occurrence of a repeated tag; repeating twitter:title or twitter:image is ambiguous and usually a template leftover.
  • An optional tag with an empty content is treated as the final value, so it should be filled or removed.
  • Known tags are the ones listed in the markup reference plus twitter:url, twitter:domain, twitter:player:stream:content_type and twitter:app:country; any other twitter: tag warns so a typo in a tag that matters (for example twitter:imag) is caught.