OG images
How to Test and Preview Your OG Image Before Publishing
June 14, 2026 · 5 min read · Grabbit Team

You added an og:image tag, pushed your changes, shared the link, and the preview is wrong: the old image, a cropped logo, or nothing at all. The fix is to preview the card before you publish, not after. This guide covers the fastest ways to test an OG image, including the case the online tools cannot handle: a page running on localhost.
The short answer
Run your page URL through a free Open Graph checker. The three that fetch your live page and render the card the way each platform would:
- opengraph.xyz scans any URL and previews the card across Facebook, X, LinkedIn, and more.
- Open Graph Validator (Orca Scan) lists every tag it found and flags what is missing.
- DebugBear's OG checker validates the tags and the image dimensions.
Paste your URL, read the rendered card, fix any tag it flags, redeploy. That covers a page that is already live. The harder cases are below.
Use the platform debuggers for the real result
The general checkers above are fast, but the platforms cache what they scrape, and that cache is what users actually see. To test against the real thing and to clear a stale preview, go to the source:
- Facebook: Sharing Debugger. Shows exactly what the crawler sees and has a Scrape Again button to force a fresh fetch.
- LinkedIn: Post Inspector. Re-fetches on every check, so it doubles as a cache buster.
- X (Twitter): X reads
og:image, but the large card only renders whentwitter:cardis set tosummary_large_image. The simplest live test is to paste the URL into a draft post and look at the attached card before sending.
If you changed your image and the old one still appears, this is almost always a cache issue. Re-scrape through Facebook's debugger or LinkedIn's inspector and it clears within minutes.
How to test an OG image on localhost
This is the question the online tools cannot answer. A social debugger runs on the platform's servers, so it has no route to http://localhost:3000. You have two options.
Option 1: expose localhost with a tunnel. Run a tunnel like ngrok to get a public URL that points at your local server, then paste that URL into any of the checkers above. This gives you the real unfurl preview while your code is still local.
Option 2: capture the OG template directly. If your OG images are generated from an HTML template (the scalable pattern, where one /og route renders the title and branding), you do not need a social crawler to see the image. You need to see what the template renders at 1200 by 630. Point a screenshot API at the template URL and inspect the returned image:
curl https://api.grabbit.live/v1/grabs \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"url": "https://your-tunnel.ngrok.app/og?title=My+Post+Title&category=Guides",
"width": 1200,
"height": 630,
"format": "png"
}'
The response returns a hosted image_url showing exactly what your template produces at the OG card size. You are checking the rendered pixels (Is the title cut off? Does the logo fit? Is the contrast readable?) rather than the social unfurl. Use a sk_test_ key while you iterate; test grabs return a deterministic placeholder and never cost a credit, so you can capture as often as you like while tuning the template.
A pre-publish checklist
Before you ship a page, confirm:
og:imagepoints to an absolute URL (includinghttps://), not a relative path. Crawlers do not resolve relative paths.- The image is at least 600 by 315, ideally 1200 by 630. Below the minimum, the card collapses to a thumbnail.
og:image:widthandog:image:heightare set so the platform reserves the right space.twitter:cardis set tosummary_large_imageif you want the large card on X.- The image URL is publicly reachable, with no auth wall or redirect in front of it. Some crawlers do not follow redirects.
- Your meta tags are server-rendered, not injected by client JavaScript. Crawlers run little to no JS.
If all six pass and the debugger still shows the wrong image, force a re-scrape to clear the cache.
Why previewing matters more for dynamic images
A single hand-made OG image is easy to eyeball once. But the moment you generate images dynamically (one per blog post, one per product, one per user) you cannot manually check every output. That is exactly when previewing through a screenshot API pays off: the same call that generates the image is the call that lets you inspect it, so you can catch a clipped title or an overflowing string before any of them go live.
This is the workflow Grabbit's screenshot API is built for. Render your OG template, capture it at 1200 by 630, store the returned image_url, and drop it into your og:image tag. Start with a free test key to dial in the template, then switch to a live key for production captures.
Wrapping up
To preview an OG image before publishing: run the live URL through opengraph.xyz or a platform debugger, force a re-scrape if a stale image is cached, and for localhost either tunnel the page out or capture your OG template directly with a screenshot API. For the tags themselves see what an OG image is and why links break, and for the exact pixel sizes see Open Graph image sizes and dimensions. To automate the generation step, read how to generate dynamic OG images from any URL.
FAQ
- How do I preview my OG image before publishing?
- Run your page URL through a free Open Graph checker like opengraph.xyz, Orca Scan's validator, or DebugBear's OG checker. Each fetches your live page, parses the og:image tag, and renders the card the way a social platform would. For pages that are not deployed yet, capture your OG template at 1200 by 630 with a screenshot API and inspect the image directly.
- How do I test an OG image on localhost?
- Social debuggers cannot reach localhost because the crawler runs on the platform's servers. Either expose your local server with a tunnel like ngrok and test the public URL, or skip the unfurl preview and capture your OG template page directly with a screenshot API so you can confirm the rendered image without deploying.
- Why does my OG image show the old image after I changed it?
- Platforms cache the scraped result aggressively. Use the platform's own debugger to force a fresh scrape: Facebook's Sharing Debugger has a 'Scrape Again' button, and LinkedIn's Post Inspector re-fetches on each check. The cache usually clears within minutes once you re-scrape.
- How do I check my OG image for X (Twitter)?
- X reads og:image automatically, but the large card only appears when twitter:card is set to summary_large_image. Paste your URL into a checker that previews the X layout, or share the link in a private draft post to see the rendered card. Confirm twitter:card is present in the page head if the preview collapses to a small thumbnail.
- What size should an OG image be when I test it?
- 1200 by 630 pixels at a 1.91 to 1 ratio. Anything under 600 by 315 drops to a small thumbnail on Facebook and LinkedIn. When you preview, confirm both the dimensions and that the important text sits away from the edges, since some apps crop a few pixels.
Capture any website with one API call
Get a free test key and capture your first screenshot in two minutes.
Written by
Grabbit Team
Screenshots as a service
The team behind Grabbit, the screenshot API for developers and AI agents. We write about web capture, rendering, and automating screenshots at scale.
Keep reading
What Is an OG Image? Why Your Shared Links Look Broken
An OG image is the preview image that appears when a link is shared on social media. Learn what it is, why it breaks, and how to automate one per page.
Jun 13, 2026 · 5 min read

Open Graph Image Sizes and Dimensions: The Complete 2026 Guide
The right Open Graph image size is 1200 by 630 pixels. Here are the exact dimensions for Facebook, X, LinkedIn, Slack, and Discord, plus how to generate OG images from a URL.
Jun 10, 2026 · 4 min read
How to Generate Dynamic OG Images from Any URL
Generate a unique Open Graph image for every page by pointing a screenshot API at your HTML template. One template, zero design work, scales to any number of pages.
Jun 12, 2026 · 4 min read