logoimghosting
Blog Post

Open Graph Images (og:image) Complete Guide: Sizes, Formats, Caching, and Fixes

Why do link previews break on WhatsApp, LinkedIn, X, and Discord even when your og:image tag looks right? Learn exact 2026 image dimensions, safe file formats, Next.js metadata setup, and cache-busting fixes.

You ship a new landing page or blog article, paste the link into WhatsApp or X, and wait for the sleek preview card. Instead, you get a plain grey box—or worse, an outdated screenshot from three deploys ago.

Social link previews look effortless until you realize every messaging app runs its own strict scraper with tight timeouts, size ceilings, and format quirks. This guide covers exact og:image dimensions, why modern formats like AVIF silently fail in crawlers, copy-paste HTML and Next.js configurations, and how to debug broken cards in minutes.

Universal Dimensions

1200 × 630 px

1.91:1 aspect ratio fits X, LinkedIn, Facebook, Discord, and Slack without awkward cropping

WhatsApp Ceiling

Under 300 KB

Heavier preview images frequently fail to render inside mobile chat bubbles on slow networks

Safest Format

JPEG or PNG

AVIF and SVG are rejected by major link scrapers; stick to standard raster formats

01 · Platform Specs

2026 Preview Image Requirements Across Major Apps

Rather than exporting five different thumbnails per page, design one master canvas at 1200 × 630 px and keep text centered inside a safe inner margin so square crops (like WhatsApp thumbnails) never slice off headlines.

Platform Ideal Size Max Weight Crawler Quirks
WhatsApp 1200 × 630 (or 600 × 600) ≤ 300 KB Strict timeout; drops WebP/AVIF on older client builds
X (Twitter) 1200 × 628 ≤ 5 MB Requires twitter:card set to summary_large_image
LinkedIn 1200 × 627 ≤ 5 MB Caches aggressively for up to 7 days without Post Inspector refresh
Facebook / Meta 1200 × 630 ≤ 8 MB Prefers explicit og:image:width and height tags
Discord & Slack 1200 × 630 ≤ 8 MB Fails silently if CDN returns 403 on bot User-Agent headers
Safe-zone design rule: Keep logos, titles, and faces inside the center 630 × 630 px square of your 1200 × 630 canvas. Wide cards on X and LinkedIn show the full width, while compact mobile shares (like WhatsApp chats and iMessage thumbnails) frequently crop to a centered square.

02 · Meta Tags & Code

Production-Ready HTML & Next.js Metadata Setup

Most broken previews happen because half the tags are missing or use relative paths like /og.png. Crawlers never resolve relative URLs reliably—always output a full https:// URL pointing straight to an edge-cached CDN asset.

Standard HTML <head> tags

head-meta.html HTML
<!-- Primary Open Graph tags -->
<meta property="og:type" content="article" />
<meta property="og:title" content="Your Page Title Here" />
<meta property="og:description" content="Clear one-sentence summary under 155 characters." />
<meta property="og:url" content="https://yourdomain.com/blog/post-slug" />

<!-- Absolute CDN image URL + explicit dimensions -->
<meta property="og:image" content="https://cdn.example.com/previews/post-v1.jpg" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Preview banner for the article" />

<!-- X / Twitter large card override -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content="https://cdn.example.com/previews/post-v1.jpg" />

Next.js App Router generateMetadata example

app/blog/[slug]/page.js Next.js
export async function generateMetadata({ params }) {
  const post = await getPost(params.slug);

  return {
    metadataBase: new URL('https://yourdomain.com'),
    title: post.title,
    description: post.excerpt,
    openGraph: {
      title: post.title,
      description: post.excerpt,
      type: 'article',
      images: [
        {
          url: post.ogImageUrl, // Direct JPEG/PNG CDN link
          width: 1200,
          height: 630,
          alt: post.title,
        },
      ],
    },
    twitter: {
      card: 'summary_large_image',
      images: [post.ogImageUrl],
    },
  };
}

03 · Troubleshooting

5 Hidden Reasons Link Previews Fail in Production

Mistake 01

Serving AVIF or SVG as og:image

Modern browsers love AVIF, but social bots run lightweight image parsers that expect JPEG or PNG. Using .avif or .svg causes WhatsApp, Slack, and LinkedIn to render a blank card without throwing an error.

Mistake 02

Exceeding WhatsApp's 300 KB Soft Ceiling

Uncompressed 1200 × 630 PNG screenshots frequently weigh 1.4 MB or more. WhatsApp stops downloading heavy thumbnails on mobile connections. Export photographic banners as 82% quality JPEG (usually 90–180 KB) and reserve PNG for flat vector graphics run through an optimizer.

Mistake 03

Bot Blocking or Slow Dynamic Generators

If your /api/og endpoint takes 4 seconds on cold start or Cloudflare's WAF challenges headless scrapers, the preview bot times out and caches "no image". Host static banners on a fast CDN or pre-generate them before sharing.

Mistake 04

Client-Side Meta Tag Injection

Social scrapers fetch raw HTML without running React useEffect hooks or heavy client JavaScript. Open Graph tags must exist in the initial server-rendered HTML response.

Mistake 05 — Redirect chains & hotlink walls: Some image services return an HTML viewer page instead of a raw image MIME type (image/jpeg), or block requests missing a browser Referer header. Always test your image URL with curl -I <url> and verify it responds immediately with HTTP 200 and Content-Type: image/jpeg or image/png.

04 · Cache Busting

Why Updated Thumbnails Stay Stuck—And How to Refresh Them

Once X, LinkedIn, or Meta fetches a URL, it stores both the scraped tags and the thumbnail image inside its own edge cache for days. Simply overwriting banner.jpg at the exact same URL will not refresh shared cards until that cache expires.

cache-busting-pattern.txt Best Practice
# ❌ Overwriting the same filename leaves old previews stuck
https://cdn.example.com/blog/launch-cover.jpg

# ✅ Versioned filename or query parameter forces scrapers to refetch
https://cdn.example.com/blog/launch-cover-v2.jpg
https://cdn.example.com/blog/launch-cover.jpg?v=20261203
imghosting.in

Clean, Crawler-Friendly Direct CDN URLs

Need permanent HTTPS image links that WhatsApp, LinkedIn, X, and Discord bots can fetch reliably without HTML wrapper pages or hotlink blocks? Upload your og:image banners to imghosting.in (manually or via POST https://api.imghosting.in/upload) and get an instant, unique direct CDN URL every upload—naturally versioned so updated banners never collide with stale social caches. Start free with 500 uploads/month (up to 20 MB per file), or upgrade to Premium from $2.49/month (3-year billing; $4.99/mo annual; $9.99/mo monthly) for 10,000 uploads/month and 50 MB max files.

05 · Debug Checklist

60-Second Pre-Publish Verification Routine

1

Inspect initial HTML with cURL

Run curl -s https://yoursite.com/page | grep -i "og:image" to confirm the tag appears in server-rendered HTML—not injected later by client JS.

2

Verify Content-Type and weight

Confirm the image URL returns HTTP 200, image/jpeg or image/png, and stays under 300 KB so WhatsApp never drops it.

3

Test in official debugger tools

Clear cached metadata using the LinkedIn Post Inspector and Meta Sharing Debugger whenever you publish major visual updates.

4

Test a real private chat message

Send the link to yourself in WhatsApp or Slack with a dummy query string (?test=1) before announcing publicly.

06 · FAQ

Frequently Asked Questions

Can I use WebP for og:image in 2026? +
Discord and modern X parsers accept WebP, but older WhatsApp builds, some email previewers, and enterprise Slack proxies still fail intermittently on WebP social cards. Using JPEG or PNG specifically for your og:image tag eliminates those edge-case failures completely.
Why does my preview show on Facebook but not on WhatsApp? +
Almost always file size or timeout. Facebook accepts preview images up to 8 MB, while WhatsApp frequently skips anything above 300 KB or images taking longer than ~2 seconds to download. Compress the banner under 250 KB and serve it from a fast CDN.
Do I need both og:image and twitter:image tags? +
X falls back to og:image if twitter:image is omitted, provided twitter:card is present. Still, including both tags explicitly guarantees predictable large-card rendering.
Does og:image affect Google Search SEO rankings? +
Google Discover and rich mobile search snippets regularly pull high-resolution (at least 1200 px wide) Open Graph images alongside articles. A clean 1200 × 630 JPEG improves click-through rates both on social feeds and in Discover cards.

Reliable preview delivery

Host your OG images once. Share clean previews everywhere.

Get permanent, crawler-friendly direct CDN URLs in seconds with imghosting.in. Free tier includes 500 uploads/month (up to 20 MB per file); Premium plans start at $2.49/month for 10,000 uploads/month.