guide

How to Add Twitter Card Meta Tags (2026)

By Rui Barreira · Last updated: 18 June 2026

Twitter Cards control how your URLs appear when shared on X (formerly Twitter). Without them, posts show a plain link. With them, you get a rich preview — title, description, image, and site attribution — that drives significantly higher click-through rates. All it takes is a handful of meta tags in your HTML <head>.

The required meta tags

Every Twitter Card needs at minimum four tags. The twitter:card tag declares the card type. twitter:title and twitter:description set the visible text. twitter:image points to the preview image, which must be publicly accessible and at least 300×157px for summary cards or 1200×628px for large image cards.

TagRequiredRecommended value
twitter:cardYessummary_large_image for articles; summary for pages
twitter:titleYesPage title, max 70 characters
twitter:descriptionYesOne-sentence summary, max 200 characters
twitter:imageYesAbsolute URL to a JPG, PNG, or WebP image
twitter:siteNoYour @handle (e.g. @yoursite)
twitter:creatorNoAuthor's @handle for article bylines

Adding the tags to your page

Place the tags inside <head> before the closing tag. If you already have Open Graph tags (og:title, og:description, og:image), Twitter falls back to those automatically — so you may only need to add twitter:cardto get basic previews. Explicit Twitter tags always take precedence over OG fallbacks, so define both when you want full control over how each platform renders the preview.

For Next.js projects, set these in the metadata export using the twitter key. For static HTML, paste the tags directly. For WordPress, a plugin like Yoast or Rank Math generates them from post fields — no manual editing required.

Validating your cards

After deploying, use the X Card Validator to confirm the tags are parsed correctly. Common issues are images blocked by robots.txt, relative image URLs (must be absolute), and titles exceeding the character limit. Cards are cached aggressively, so append a query string or wait up to seven days for an updated image to propagate.

Use the Twitter Card Generator to build and preview your tags instantly without touching code.

Frequently Asked Questions

Is this tool free?
Yes — completely free, no signup required. All processing happens in your browser.
Does the tool work offline?
Once loaded, most features work without an internet connection since everything runs client-side.
More free toolsSee all 469
Merge PDFsCompress ImageJSON FormatterPassword GeneratorVAT CalculatorQR Code Generator
How to Add Twitter Card Meta Tags (2026) | brevio