Guide · Updated May 2026

Open Graph image SEO: size, Next.js metadata, Google thumbnails & LLM crawlers

Answers the queries teams actually type into Google and into LLMs: open graph image size, og:image vs twitter:image, Next.js generateMetadata, Facebook/LinkedIn cache refresh, Google Search & Discover thumbnails, and what to put in JSON-LD plus /llms.txt so AI crawlers cite you correctly.

1200×630 PNGog:image

How we shipped launch cards

Dynamic Open Graph images from one API URL

by OGKitOGKit

What crawlers should see

A canonical HTTPS preview image, matching og:title, and structured data that repeats the same article intent. This is the visual contract for Google thumbnails, Slack unfurls, LinkedIn cards, and LLM browsing surfaces.

Recommended implementation path

Start in the Playground with demo=1 so designers and engineers can agree on the card before production keys exist. Then wire the final URL using the HTTP API reference and decide whether the page needs public signed URLs or a simple server-side key.

For Next.js teams, the fastest route is the App Router guide: build the image URL in generateMetadata, mirror it in twitter.images, and validate the deployed page with the preview debugging tools. If you are still choosing between in-repo rendering and hosted URLs, compare OGKit vs @vercel/og and Satori vs Puppeteer.

Metadata flow: from page content to visible previews
1

Page data

title, summary, author

2

OGKit URL

/api/og/article?...

3

1200×630 PNG

cached image bytes

4

Distribution

Google, Slack, LLMs

TL;DR

Open Graph (OG) and Twitter/X card metadata control how your URLs look when shared in Slack, Discord, LinkedIn, iMessage, and search-driven discovery. A strong setup uses one canonical HTTPS image per URL, stable 1200×630 dimensions, readable typography at thumbnail size, and titles that still make sense when truncated.

Hosted template APIs like OGKit trade maximum layout freedom for operational simplicity: you pass title, subtitle, logo, and product fields as query parameters instead of maintaining Satori JSX, headless Chrome, or design-tool pipelines yourself. For Next.js teams, the usual integration point is generateMetadata on the server, which keeps secrets out of the client bundle.

Skim the rest of this guide for internal links to the HTTP reference, pricing, the live Playground, the dynamic previews use-case page, and the Next.js-specific framework guide—then ship a first preview URL in minutes using demo mode.

Why link previews matter for distribution and SEO

Social networks and messengers increasingly behave like secondary search engines: the image, title, and description decide whether someone opens your tab or keeps scrolling. Even when rankings are stable, a weak preview lowers click-through from the same position because humans compare adjacent cards in the feed.

From an SEO lens, previews reinforce topical relevance. When your article title, hero art, and meta description align with the query intent, you reduce pogo-sticking after the click. That alignment is easier when the preview image is generated from the same structured data you already store for the page—release name, price, author, or doc section—rather than a single static marketing banner reused everywhere.

Latency and caching matter too. Crawlers and unfurlers fetch og:image as a separate HTTP resource. Deterministic URLs that include only stable fields (or a signed hash of them) help CDNs cache aggressively, which keeps Slack and LinkedIn rescrapes fast when a link is reshared weeks later.

The minimum viable metadata stack

At the HTML layer you typically emit og:title, og:description, og:image, og:image:width, og:image:height, twitter:card, and twitter:image alongside your canonical link element. Width and height help clients reserve aspect ratio before the PNG finishes downloading, which avoids layout jump in some in-app browsers.

Absolute HTTPS URLs are non-negotiable: relative og:image paths break in aggregators that resolve against the wrong host, and http URLs fail mixed-content expectations on modern clients. If your app is mounted under a path prefix, bake that prefix into outbound marketing links so canonicals, sitemaps, and image URLs stay consistent.

When you evaluate vendors, ask how they handle cache headers, signed URLs for public endpoints, and per-plan quotas. Those operational details matter more than pixel-perfect gradients once you are rendering thousands of cards per month across blogs, changelogs, and programmatic landing pages.

Next.js App Router patterns that survive code review

The App Router encourages colocating SEO with routes via the metadata API. Build your preview image URL in generateMetadata or a small server-only helper, assign it to openGraph.images and twitter.images, and never import API secrets into client components. That single rule prevents an entire class of security regressions when someone later refactors a page to a client boundary.

If you compare maintaining opengraph-image.tsx with a hosted OG API, the trade-off is control versus toil. Custom routes shine when every page needs bespoke JSX. Template APIs shine when product, growth, and docs teams want predictable cards without waiting on a frontend deploy for every copy tweak.

For a focused walkthrough with pitfalls and snippets, read the OGKit Next.js framework page linked below; it mirrors what we document in the HTTP API reference and pairs well with the comparison articles when you are choosing between hosted templates and in-repo Satori.

Good URL

https://www.webmorp.art/api/og/article?title=Open+Graph+SEO&demo=1

Bad preview

One generic homepage banner reused on every article and changelog.

Next.js hook

generateMetadata() returns openGraph.images + twitter.images on the server.

Worked examples: SaaS, docs, ecommerce, and changelogs

SaaS marketing sites benefit from brand-forward cards: logo, short tagline, and a restrained accent color so the preview still reads when Slack shrinks it. Documentation sites often prefer code-forward or minimal templates so the page title and section name carry the signal. Ecommerce share cards should show price and product photography where policy allows, because those fields answer the first shopper question before the click.

Changelog and release-note URLs are easy to neglect: teams reuse the homepage OG image and wonder why engagement is flat. A simple pattern is one card per release with the version in the title and two lines of summary text. That small habit compounds when power users subscribe to RSS or social mirrors of your feed.

Internal education matters: link writers should know that editing page copy without regenerating the OG URL can leave stale previews until caches expire. Either version your query string when content changes materially or rely on a signing scheme that rotates when the underlying record updates.

Mistakes that pass CI but fail in the wild

Using client-side-only metadata updates is the classic SPA pitfall: crawlers and most unfurlers do not execute your JavaScript bundle. Anything that matters for distribution must be present in the first HTML response.

Another failure mode is gigantic custom fonts or unbounded text: preview renderers enforce tight timeouts. Template systems that cap line counts and font file sizes behave more predictably than unconstrained screenshot browsers on cold start.

Finally, mixing testing and production keys in the same environment variables creates incidents. Keep demo mode for design reviews, signed URLs when exposing generation to the public internet, and domain allowlists when a single key must serve multiple properties.

How to measure whether previews are working

Use official debugger tools and your own staging fetches: curl the page HTML, extract og:image, then curl the image URL and inspect content-type, cache-control, and total bytes. Large PNGs are fine at 1200×630 if compression is tuned; runaway megabytes suggest a misconfigured screenshot pipeline or lossless assets that should be quantized.

Watch referral quality from social and community sites after you ship dynamic previews. You should see higher session depth when cards match destination content because visitors arrive with accurate expectations.

When you are ready to automate generation in production, start with the HTTP docs, validate keys in the dashboard, and keep llms.txt in sync so coding agents pick up canonical examples without inventing hosts.

Checklist before you call previews done

One primary H1 on the destination page, supporting H2/H3 sections, and metadata titles that do not fight the visible headline.

One OG image URL per canonical URL, absolute HTTPS, width and height meta, twitter:image mirroring og:image unless you intentionally diverge.

Quotas, signing, and key rotation documented for whoever operates billing—not only the engineer who wired the first prototype.

Image dimensions and safe-area typography

The consensus dimension across Open Graph scrapers is 1200×630 pixels at a 1.91:1 ratio. LinkedIn and Twitter/X render large cards at approximately that ratio; Slack and iMessage sometimes crop narrower on small viewports. Keep a 64 px safe margin on all sides and avoid pinning meaningful text within the outer 10 percent of the canvas so nothing important is clipped when clients crop to a square thumbnail in notifications or mobile previews.

Font size matters more than layout cleverness. A 72–96 px headline holds up across desktop feeds, mobile browsers, and shrunk Slack thumbnails; anything under 48 px starts to blur below 400 px rendering width. Limit headlines to two lines and use a conservative line-height so rogue long titles do not overflow into logo zones or clip the author byline. When a template offers a "dark" theme, ensure body text clears WCAG AA contrast against the darkest background patch, not just the average.

PNG is the default output format because every major scraper decodes it losslessly and sizes stay below a few hundred kilobytes with modern palette optimization. Avoid JPEG for text-heavy cards — chromatic compression artifacts show up first on sharp letterforms and logos. WebP and AVIF are faster but not universally supported in older unfurlers, so they should remain an option, not a default.

How LLM crawlers and AI search surfaces read previews

Google and Bing are no longer the only audiences for Open Graph metadata. Perplexity, ChatGPT browsing, Claude and Gemini retrieval pipelines, Cursor Docs, and other AI systems fetch HTML and extract structured data (Open Graph, Twitter cards, schema.org JSON-LD) to build citations and previews. If your og:image is a generic brand splash and your schema.org block is missing, the AI surface shows a weaker card than a competitor who spent a day on metadata — and AI users rarely scroll deeper in the result set.

A robust setup gives AI crawlers three layers: a canonical HTTPS og:image (1200×630), a schema.org Article or TechArticle node with headline and description, and a text-based companion file at /llms.txt that summarizes the site in machine-readable form. Each layer reinforces the others: the image gives the UI, the JSON-LD gives the semantic summary, and the llms.txt gives crawlers a deterministic index to choose which URL to cite. OGKit already ships an llms.txt route — inspect it, extend it, and keep canonical URLs aligned with your sitemap.

Operationally, this means your preview system is part of the retrieval pipeline, not just a social-share nicety. Treat og:image generation as deterministic infrastructure — stable URLs, short cache TTLs for content edits, and signed keys for public pages — so AI ranking models see the same card a human would. The same discipline that wins Google rich results increasingly wins AI citation placement.

Troubleshooting the most common failure modes

When a preview refuses to update, the problem is almost always caching. Facebook, LinkedIn, and Slack aggressively remember the first og:image they fetched for a URL; editing the image without a cache-busting query string or a forced rescrape leaves the old card live for days. Run the Facebook Sharing Debugger, LinkedIn Post Inspector, and Twitter Card Validator after every material change to force a refresh, and consider versioning the image URL with a short content hash so CDNs see a new resource automatically.

When a preview renders but looks broken (cropped text, missing logo, wrong colors), inspect two things. First, view the og:image URL directly in a browser and confirm the PNG itself is correct at full 1200×630. If the PNG is fine, the issue is with the consuming client — LinkedIn, for example, applies its own recompression and can darken thin text. Second, check that og:image:width and og:image:height meta tags match the served PNG, because some scrapers use those hints to skip aspect-ratio guessing.

When the preview is simply missing, the usual culprits are a relative og:image URL, a missing Content-Type, a 4xx from the image host, or a CSP/CORP header that blocks external fetch. A final check: inspect the raw HTML of the page with curl — not a rendered view in DevTools — to confirm the metadata ships in the first response. Many SPA bugs disappear only after a server-side render is configured; otherwise the metadata lives only in client JavaScript that scrapers never execute.

Where to go next on OGKit

Frequently asked questions

Same Q&A as the FAQPage JSON-LD on this route—helpful for people, Google rich results, and LLM retrieval.

What is the recommended Open Graph image size?
Use 1200×630 pixels (about 1.91:1) for Open Graph and most Twitter/X large image cards. Google may also use og:image and structured data for thumbnails in Search and Discover; very small images (under ~200×200) are often rejected.
Does Google use Open Graph images?
Google can use og:image together with schema.org markup (for example primaryImageOfPage or image on the main entity) when choosing thumbnails in Search and Discover. Strong alignment between title, description, og:image, and visible page content improves click-through.
Should og:image be an absolute URL?
Yes. Use an absolute HTTPS URL (include your public path prefix if the app is mounted below the domain root) so Slack, LinkedIn, Discord, iMessage, and crawlers fetch exactly the bytes your HTML references.
How do I set og:image in Next.js App Router?
Build the final image URL in generateMetadata or another server-only path, then assign it to metadata.openGraph.images and metadata.twitter.images. Never put API secrets in client components—only the generated HTTPS URL belongs in the head.
Why is my link preview wrong or cached on Facebook or LinkedIn?
Most platforms cache the first successful og:image they see for a URL. After you change art or copy, use the Facebook Sharing Debugger and LinkedIn Post Inspector to force a rescrape, or version the image URL (query string or new path) so caches see a new resource.
Can I use SVG or WebP for og:image?
Many scrapers expect PNG or JPEG for social previews; SVG is a poor default because not every consumer rasterizes it reliably. WebP/AVIF can work in some stacks but PNG at 1200×630 is the safest default for universal unfurling.
Do Open Graph tags affect rankings directly?
They are not a classic ranking factor like backlinks, but they strongly affect click-through from search and social, and they feed AI browsing tools that read HTML metadata. Weak or missing og:image hurts perceived quality next to competitors.
What should I ship for LLM crawlers (ChatGPT, Perplexity, etc.)?
Ship a canonical og:image, concise Article or TechArticle JSON-LD, and a machine-readable /llms.txt that points to your docs and guides. Consistent URLs across sitemap, canonical, and examples reduce hallucinated hosts in coding agents.
How large can an Open Graph image be before timeouts?
Stay well under ~1 MB for the PNG when possible; multi‑MB files increase rescrape failures on slow hosts. Prefer tuned PNG compression and capped typography instead of huge embedded assets.

OGKit turns one HTTPS URL into a 1200×630 Open Graph image. Read the API reference, the Open Graph SEO guide, try the Playground, or sign in to create API keys.