All topics

How to Test Your OG Images Before Going Live

You just spent time creating a great OG image, but how do you know it actually works before sharing your link with the world? Testing OG images is surprisingly tricky because each platform has its own crawler, caching rules, and rendering quirks.

Using Platform-Specific Debugger Tools

Facebook's Sharing Debugger (developers.facebook.com/tools/debug) is the gold standard for OG tag validation. Paste your URL and it shows exactly which tags it found, the image it will display, and any warnings. Twitter's Card Validator works similarly for Twitter-specific tags. LinkedIn has its Post Inspector tool that shows how your link will appear in the LinkedIn feed. Each of these tools makes a fresh request to your server, bypassing their normal cache, so they show you the current state of your tags. Bookmark all three and run your URLs through them before any major launch or content publish.

Testing from Localhost and Staging Environments

The biggest challenge with OG image testing is that social platform crawlers cannot reach localhost or private staging servers. You have a few options: use a tunneling service like ngrok or Cloudflare Tunnel to temporarily expose your local server, deploy to a staging URL that is publicly accessible, or use a tool that simulates the crawl locally. For Next.js developers, you can inspect the HTML source directly to verify the meta tags are rendered correctly, then test the image URL independently by pasting it into a browser. Another approach is to use curl or a script that fetches your page and parses the OG tags, giving you quick validation without needing a public URL.

Visual Testing Across Devices

Even if the debugger tools say everything is valid, you should visually check how your OG image looks in context. Share your link in a private Slack channel, a test Discord server, a private Twitter account, and an iMessage conversation with yourself. Each platform renders the card slightly differently: some add rounded corners, some overlay a play button icon for video content, and mobile versus desktop layouts can vary significantly. Take screenshots on both phone and desktop to catch any cropping or sizing issues that automated tools miss. This five-minute manual check can save you from embarrassing previews on launch day.

Automated OG Tag Validation in CI/CD

For teams that publish content frequently, integrating OG tag validation into your CI/CD pipeline catches issues before they reach production. You can write a simple test that fetches each page, parses the HTML for required OG tags, validates that the image URL returns a 200 status, and checks that the image dimensions meet minimum requirements. Libraries like cheerio or jsdom make HTML parsing easy in Node.js. Some teams use Playwright or Puppeteer to render pages and extract meta tags, which also catches issues with client-side rendered OG tags that might not be present in the initial HTML response.

Dealing with Caching After Updates

One of the most frustrating aspects of OG images is aggressive caching by social platforms. Facebook caches OG data for about 30 days, so if you fix a typo in your og:title or replace your image, the old version continues showing up when people share your link. The Facebook Sharing Debugger has a 'Scrape Again' button that forces a refresh. For Twitter, re-validating in the Card Validator usually updates the cache. LinkedIn is the slowest to update and sometimes requires waiting 24 hours. To avoid caching headaches entirely, get your OG tags right before the first person shares your URL, because the first scrape is what gets cached.

Generate your OG image in seconds

Paste a title, pick a brand color, and get production-ready social cards for every platform — with framework-specific meta tag snippets included.

Create OG Images You Can Be Confident About