Missing Twitter/X card in Vanilla JS
X (Twitter) reads twitter:card to decide how to render a shared link. Without it, your link may appear as bare text instead of a rich card with image and headline. While X often falls back to Open Graph tags, declaring the card type explicitly guarantees the large-image layout.
Symptoms
How VibeCheck catches it
In your widget · Problems
Missing Twitter/X card
To your coding agent · MCP
agent › get_detected_issues
→ { detector: "seo", issue: "Missing Twitter/X card", threshold: "no <meta name="twitter:card">" }
The same string in your widget and in your agent’s context — no screenshot, no copy-paste.
Root causes
The fix for Vanilla JS
Add the twitter:card tag to each page’s <head>. X reuses your og:image/title/description, so the card type is usually all you need.
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:site" content="@acme" />Steps
- Add
<meta name="twitter:card" content="summary_large_image"> - Ensure
og:image/title/descriptionare present (X reuses them) - Validate the card in X’s card preview tooling
FAQ
- Do I need
twitter:*tags if I already haveog:*tags? - X falls back to
og:*for image, title, and description, but you should still settwitter:cardto guarantee thesummary_large_imagelayout. - What card types exist?
- The common ones are “
summary” (small square thumbnail) and “summary_large_image” (full-width image). Use the latter for most content pages. - What are
twitter:siteandtwitter:creatorfor? - They attribute the card to X handles —
twitter:siteto the publishing account,twitter:creatorto the author. They are optional and don’t change the layout, but they add the “@handle” byline on the card. - My
og:imageis 1200×630 — does it work as a Twitter card? - Yes.
summary_large_imageuses the same 1200×630 (1.91:1) image as Open Graph, so one image covers both. X readsog:imagewhen no separatetwitter:imageis set.