../courses.php
HEAD
HEAD107
90
Twitter / X Cards
Add preview metadata for X and Twitter-style link cards.
How does the head control X/Twitter link cards?
Twitter card meta tags tell X/Twitter-style platforms what card type, title, description, and image to use when the page is shared.
Open Graph handles many sharing previews, but some platforms also read Twitter card metadata.
These tags are similar to Open Graph, but they use
name="twitter:..."
instead of
property="og:...".
The goal is the same: make the shared page preview clear, honest, and useful.
The most common card type for a visual preview is
summary_large_image.
Twitter card metadata
<head>
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Jit HEAD - Learn The HTML Head">
<meta
name="twitter:description"
content="Learn how the HTML head controls search, sharing, icons, mobile setup, indexing, and AI previews.">
<meta name="twitter:image" content="https://en.jit4all.com/og-head.png">
<meta name="twitter:image:alt" content="Jit HEAD course preview card">
</head>
twitter:card
sets the preview card type.
summary_large_image
requests a larger image preview.
twitter:title
sets the card title.
twitter:description
sets the card summary.
twitter:image
sets the card image.
Platform support
Some platforms read Twitter card tags for better previews.
Preview control
You decide the card title, image, and summary.
Consistency
Twitter card tags can match your Open Graph tags.
Clarity
A clear preview helps people decide whether to open the link.
Weak X/Twitter preview
<meta name="twitter:title" content="Page">
Better X/Twitter preview
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Jit HEAD - Learn The HTML Head">
<meta name="twitter:image" content="https://en.jit4all.com/og-head.png">
Ask ChatGPT: "Do these Twitter card tags match the Open Graph tags and describe the page honestly?"
Add
twitter:card.
Add
twitter:title.
Add
twitter:description.
Add
twitter:image.
Make the Twitter card match the Open Graph card.
Using a different title than the Open Graph card without a reason.
Forgetting the card type.
Using a relative image URL.
Using an image that is too small or unrelated.
Writing preview metadata that does not match the page.
Add Twitter / X card metadata so shared links can show a clear title, description, and image preview.
Login - Jit4All
Login
Welcome back to Jit4All