How to Fix Missing Twitter/X Card Tags on Your Website

This check flags pages that have no twitter:card meta tag in their HTML head, so links shared on X (formerly Twitter) show up as plain text or a tiny thumbnail. By the end of this guide, every page template on your site will output a twitter:card tag set to summary_large_image, plus a title, description and image that X can read.

By Updated ⏱ 15–30 minutes🎯 Beginner● Low impactOn-Page
Illustration: Twitter/X card tags fix guide
ON-PAGE · FIX GUIDE Twitter/X card tags IMPACTEFFORT TIME15–30 minutes LEVELBeginner

Why it matters

X builds link previews only from meta tags in the page head. Without twitter:card, a shared link usually gets a small card or no card at all, and posts with large image cards take up more of the timeline and get more clicks. The tag has no direct effect on Google rankings, which is why the impact is low.

It does affect click-through from social shares, and the same title, description and image tags are read by Slack, Discord, LinkedIn and many AI chat tools when they unfurl links.

✕Before<head> contains a title and metadescription but no twitter:card tag,so the link appears on X as a plain✓After<meta name="twitter:card"content="summary_large_image"> plus atitle, description and absolute image

What you need

Access to your site's theme files, SEO plugin, or CMS page settings
A share image per page or a site-wide default, ideally 1200×630 px (JPG, PNG or WebP, under 5 MB)
A terminal with curl, or your browser's View Source

Step-by-step fix

1

Find which pages are missing the tag

Open your audit report and note the URLs flagged by this check. The check tests every crawled page, so if most of your pages fail, the problem is in a shared template (header, layout or theme). If only a few pages fail, look for a separate template or landing-page builder.

To confirm, check one URL from the command line.

text
curl -s https://example.com/ | grep -i 'twitter:\|og:'
Pro tip: If the curl output shows no tags but the browser's Elements panel does, the tags are being added by JavaScript after load. X's crawler does not run JavaScript, so the tags need to be in the server-rendered HTML.
2

Prepare a share image and an absolute URL

summary_large_image shows the image at a 2:1 ratio. Use 1200×630 px (minimum 300×157, maximum 4096×4096), under 5 MB, in JPG, PNG, WebP or GIF format (only the first frame of a GIF is used). Upload the image somewhere public and copy its full https:// URL.

png are not reliable for X.

Pro tip: Keep text and logos inside the central area of the image. X and other apps crop the edges differently.
3

Add the tags to the <head> of every page template

Paste the tags into the shared head template so every page gets them. X reads og:title, og:description and og:image as fallbacks, so the only X-specific tag you need is twitter:card. You can add twitter:title and twitter:image if you want X to show different text or a different image than other platforms.

Put page-specific values in the title and description rather than repeating the site name on every page.

html
<meta property="og:title" content="Example Co — Page Title">
<meta property="og:description" content="One sentence describing what this page offers.">
<meta property="og:image" content="https://example.com/images/og-image.png">
<meta property="og:url" content="https://example.com/page/">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:image:alt" content="Example Co dashboard showing a weekly report">
Pro tip: twitter:* tags use the name attribute, while og:* tags use property. X accepts either attribute on twitter tags, but name is the documented form.
4

Use per-page values on dynamic templates

For blog posts, products and other dynamic pages, fill the tags from the page's own data instead of hardcoding them. Use the featured image as twitter:image or og:image when one exists, and fall back to the site default when it doesn't. The Next.js example below shows this, and the same pattern applies to Liquid, PHP or any other template language.

javascript
export const metadata = {
  openGraph: {
    title: 'Page Title | Example Co',
    description: 'One sentence describing what this page offers.',
    images: ['https://example.com/images/og-image.png'],
    url: './',
  },
  twitter: { card: 'summary_large_image' },
};
Pro tip: Avoid emitting the same tag twice, for example once from your theme and once from a plugin. Duplicate tags with different values give unpredictable previews.
5

Clear caches and deploy

Purge your page cache (caching plugin, CDN or host cache) so crawlers get the new HTML. X caches card data for each URL for about 7 days. Already-posted links may keep their old preview, but new posts will use the new tags.

Pro tip: To make X fetch fresh card data right away for testing, add a throwaway query string such as ?v=2 to the URL.
6

Verify the tags and the live preview

Run curl again on several flagged URLs from different templates (home, a blog post, a product) and confirm twitter:card appears in the raw HTML. Then paste a URL into the X post composer. X no longer shows a preview in its old Card Validator, but the composer renders the card before you publish.

Finally, re-run the audit and confirm the number of flagged pages has dropped to zero.

text
curl -s -A "Twitterbot/1.0" https://example.com/blog/post/ | grep -io '<meta[^>]*twitter:card[^>]*>'

Platform-specific notes

WordPress

In Yoast SEO, go to Yoast SEO → Settings → Site features and make sure 'X card data' is enabled. You can set per-post images in the post editor under Yoast → Social. In Rank Math, go to Rank Math → Titles & Meta → Social Meta and set Twitter Card Type to 'Summary Card with Large Image'. Only hand-edit header.php in a child theme if you use no SEO plugin.

Shopify

Most current themes, including Dawn and other Online Store 2.0 themes, output twitter:card through snippets/meta-tags.liquid rendered in layout/theme.liquid. If yours doesn't, add the tags there and use {{ page_title }}, {{ page_description }} and {{ page_image | image_url: width: 1200 }}. Set the default image under Online Store → Preferences → Social sharing image.

Wix

Wix outputs X card tags automatically. Edit them per page under Pages → (page) → SEO basics / Social share, where X has its own tab. For dynamic pages, edit them in the SEO settings of the dynamic page template. You cannot add raw head tags to individual pages on most plans.

Webflow

Set the title, description and image under Page settings → Open Graph settings. For CMS templates, bind these fields to collection fields. If the twitter:card tag is missing from the published HTML, add it in Site settings → Custom code → Head code so it applies site-wide.

Next.js (App Router)

Define openGraph and twitter in the metadata export in app/layout.tsx and override them in page.tsx or generateMetadata. A child route that sets openGraph replaces the parent's openGraph object entirely, so repeat the image there. Set metadataBase in the root layout so relative image paths become absolute URLs.

Check that it worked

✅ How to verify

  • Run curl -s https://example.com/any-page/ | grep -i twitter:card and confirm the tag appears in the server HTML, not only in the browser's rendered DOM.
  • Paste a fresh URL (or one with ?v=2 added) into the X post composer and confirm a large image card renders with the correct title.
  • Spot-check one URL from each template type: home, article, product, category and landing page.
  • Re-run the site audit and confirm the Twitter/X card check reports no affected pages.

⚠️ Common mistakes

  • Adding the tags with Google Tag Manager or client-side JavaScript. X's crawler only reads the initial HTML.
  • Using a relative or http:// image URL, or an image blocked by robots.txt or hotlink protection. The card then falls back to a small or blank preview.
  • Adding tags only to the homepage when the check tests every page. Put them in the shared layout template.
  • Running both a theme and an SEO plugin that each output Open Graph and X tags, which creates conflicting duplicates.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

Do I need twitter:title and twitter:image if I already have Open Graph tags?

No. X falls back to og:title, og:description and og:image. The one tag it needs that Open Graph doesn't provide is twitter:card. Add twitter:title or twitter:image only if you want X to show something different.

What's the difference between summary and summary_large_image?

summary shows a small square thumbnail next to the text. summary_large_image shows a wide 2:1 image above the title, which is more visible in the timeline. For most pages with a decent image, summary_large_image is the better choice.

Why is my X preview still showing the old image?

X caches card data for each URL for about 7 days. New posts using a slightly different URL (for example, with a query string) will fetch fresh data. Also check that your CDN or page cache was purged.

Is the Twitter Card Validator still available?

The validator no longer shows previews. To test a card, paste the URL into the X post composer, which renders the card before posting. Checking the raw HTML with curl confirms the tags are present.