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 |
|---|---|---|---|
| 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 |
| 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 |
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
<!-- 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
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
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.
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.
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.
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.
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.
# ❌ 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
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
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.
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.
Test in official debugger tools
Clear cached metadata using the LinkedIn Post Inspector and Meta Sharing Debugger whenever you publish major visual updates.
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? +
og:image tag eliminates those edge-case failures completely.
Why does my preview show on Facebook but not on WhatsApp? +
Do I need both og:image and twitter:image tags? +
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? +
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.
Read More Related Articles
WebP vs AVIF in 2026: Which Image Format Actually Wins for Speed, Quality, and Browser Support?
WebP dominated the last decade, but AVIF is rewriting the rules in 2026. We benchmark both formats across file size, visual quality, encoding speed, and real-world browser support—so you can pick the right format for your project today.
Free Image API with Cheap Plans in 2026: Pricing, Limits, and Working Code
Compare real free image hosting APIs that offer genuinely affordable upgrade paths instead of sudden $89/month pricing cliffs—complete with 2026 quotas, trade-offs, and copy-paste cURL, JavaScript, and Python code.