Twitter cards, now called X cards, are meta tags in a page’s <head> that control how a shared link looks as a preview on X, with title, description and image. They affect the preview on X and are not a signal for Google Search.
How do they work?
twitter:card sets the card type. Common values are summary, with a small image, and summary_large_image, with a large landscape image. twitter:title, twitter:description and twitter:image add the content. When twitter:title, twitter:description or twitter:image is missing, X falls back to og:title, og:description and og:image, according to the archived Twitter documentation. The Open Graph protocol requires four properties on every page: og:title, og:type, og:image and og:url.
The original cards documentation is no longer available on the current X developer pages, so this entry relies on an archived copy. The name dates from before Twitter became X. The tags are still prefixed twitter:.
Example
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Page title">
<meta name="twitter:description" content="Short description.">
<meta name="twitter:image" content="https://www.example.com/preview.jpg">
Common mistakes
The image URL is relative, not public, blocked by robots.txt or does not return status 200. The preview then fails. Sharing the public URL on X shows what arrives.
Sources
- The Open Graph protocologp.me
- Twitter Cards and X sharing – The SEO Framework (secondary)kb.theseoframework.com
- Twitter Cards meta tags – Simplified eLearning (secondary)simplifiedelearning.in
- Cards Markup Tag Reference – Twitter Developer Platform (archived copy, Internet Archive 2024)web.archive.org
Last updated: