Home / Guides

Link preview not showing? Fix og:image and twitter:card

Blank card when you share your app on X, Slack or Discord? The exact Open Graph and X card tags to add, image size rules quoted from the docs, and how to test before you post.

Updated 2026-11-16 · ShipCheck guides

Check your preview tags now

Paste your live URL. ShipCheck flags missing og:title, og:description and og:image, checks that your og:image actually loads (plus headers, leaked keys and speed) with copy-paste fixes. Free, no signup.

Short answer: put og:title, og:type, og:url and an og:image with a full https:// URL in the HTML your server sends, plus <meta name="twitter:card" content="summary_large_image"> for a big card on X. Most blank previews come from a relative image path, an image the crawler can't reach, or tags that only appear after JavaScript runs.

Checked on 2026-11-09 against the Open Graph protocol (ogp.me), X's Summary Card with Large Image docs (archived Jan 12, 2026) and Slack's unfurling docs. X's current developer site (docs.x.com) no longer has the card pages, so the X rules below come from the archived copy.

1. The tags to copy

Paste this into <head> and change the values. Every URL must be absolute.

<meta property="og:title" content="My App: what it does in a few words">
<meta property="og:type" content="website">
<meta property="og:url" content="https://myapp.com/">
<meta property="og:image" content="https://myapp.com/og.png">
<meta property="og:image:alt" content="What the image shows">
<meta property="og:description" content="One or two sentences about this page.">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="My App: what it does in a few words">
<meta name="twitter:description" content="One or two sentences about this page.">
<meta name="twitter:image" content="https://myapp.com/og.png">

Why these: ogp.me lists og:title, og:type, og:image and og:url as "the four required properties for every page", and says a page with an og:image "should specify og:image:alt". X's docs mark twitter:card (set to summary_large_image) and twitter:title as required for the large card.

2. The image rules

3. Why the card is still blank

4. Framework snippets

Next.js (App Router)

// app/layout.tsx
export const metadata = {
  metadataBase: new URL('https://myapp.com'),
  title: 'My App',
  description: 'One or two sentences about this page.',
  openGraph: { type: 'website', url: '/', images: [{ url: '/og.png', width: 1200, height: 600, alt: 'What the image shows' }] },
  twitter: { card: 'summary_large_image' },
};

Next.js 16: four things that blank the card

Checked on 2026-11-13 against the Next.js docs for generateMetadata and the opengraph-image file convention.

// app/blog/[slug]/page.tsx: keep the layout's image when you override openGraph
import type { Metadata, ResolvingMetadata } from 'next'

export async function generateMetadata(
  { params }: { params: Promise<{ slug: string }> },
  parent: ResolvingMetadata
): Promise<Metadata> {
  const { slug } = await params
  const previousImages = (await parent).openGraph?.images || []
  return {
    title: `Post ${slug}`,
    openGraph: { title: `Post ${slug}`, images: previousImages },
  }
}

Vite, Lovable, Bolt or plain HTML

Put the tags from step 1 directly in index.html, and put og.png in public/ so it is served at https://yourdomain/og.png.

5. Test before you post

# Are the tags in the HTML the server sends?
curl -sL https://myapp.com/ | grep -iE 'og:|twitter:'

# Next.js with generateMetadata: what does a preview bot get?
curl -sL -A 'facebookexternalhit/1.1' https://myapp.com/ | grep -iE 'og:|twitter:'

# Does the image load for a logged-out visitor, as an image?
curl -sIL https://myapp.com/og.png | grep -iE '^HTTP|content-type|content-length'

You want 200, an image/ content type, and a size under 5MB. Then run a free ShipCheck scan: it flags missing title, description, viewport and Open Graph tags, and now also fetches your og:image to confirm it is an absolute URL that loads as an image under 5MB, alongside headers, leaked keys and speed.

Sister project: making a browser game? WishlistForge's guides cover turning players into Steam wishlists.

Sister project (AgentCartridge, same owner): og:image and link preview rules file for Cursor and Claude Code, so your AI builder adds these tags on every new page.

FAQ

What size should my og:image be for X?

X's card docs (archived January 2026) say summary_large_image images support a 2:1 aspect ratio, at least 300x157 and at most 4096x4096 pixels, under 5MB, as JPG, PNG, WEBP or GIF. 1200x600 fits all of that. X's current developer site no longer hosts that page, so we quote the archived copy.

Why does my link preview work locally but not when I share it?

Crawlers can only read what your live server sends. A relative og:image path, an image behind a login or Vercel deployment protection, or tags added by client-side JavaScript after load all leave the card blank. Check the raw HTML with curl, and open the image URL in a private window.

Do I need twitter: tags if I already have og: tags?

Add twitter:card at least: X's docs mark it required and it is how you ask for the large image card. Slack's docs say it reads both Open Graph and X card metadata, so a full og: set plus twitter:card covers X and Slack.

More guides

The vibe-coded app launch checklist

A practical pre-launch checklist for apps built with Lovable, Cursor, Bolt, v0 or Replit.

How to add security headers on Vercel

Copy-paste vercel.json for CSP, HSTS and friends, plus how to test them.

How to fix slow LCP in a vibe-coded app

Hero images, fonts, client-side rendering, JS bundles and caching.