Open Graph Preview: Complete Guide for Developers & Marketers
Everything you need to know about Open Graph protocol, social media previews, and optimizing link cards for maximum engagement.
What is Open Graph?
The Open Graph protocol was created by Facebook in 2010 to standardize how web pages are represented when shared on social media. Today, it's used by virtually every major platform including Facebook, Twitter (X), LinkedIn, Slack, Discord, WhatsApp, Telegram, and iMessage.
Open Graph tags are HTML <meta> elements placed in the <head> section of your web pages. They control the title, description, image, and other metadata that appears when someone shares your URL.
Basic Example
<head>
<meta property="og:title" content="Your Page Title" />
<meta property="og:description" content="A compelling description" />
<meta property="og:image" content="https://example.com/image.jpg" />
<meta property="og:url" content="https://example.com/page" />
<meta property="og:type" content="website" />
</head>๐ก Test Your Open Graph Tags
Use our Open Graph Preview Tool to instantly see how your tags will appear across all major platforms.
Why Open Graph Previews Break
The most common frustrations developers face with Open Graph:
- Aggressive caching - Platforms cache OG tags for days or weeks
- Missing tags - Forgetting required properties like
og:image - Wrong image sizes - Images that are too small, too large, or the wrong aspect ratio
- Broken image URLs - Relative paths, localhost URLs, or blocked resources
- Client-side rendering issues - SPAs that inject meta tags after the page loads
Platform-Specific Differences
While Open Graph is a standard, each platform implements it slightly differently:
Facebook & Meta
- Recommended image size: 1200ร630px
- Minimum image size: 200ร200px
- Supports video tags (
og:video) - Use the Facebook Sharing Debugger to test
Twitter / X
- Falls back to OG tags but prefers Twitter-specific
twitter:cardtags - Recommended image size: 1200ร675px (summary_large_image)
- Requires
twitter:cardto be set (usually "summary_large_image") - Learn more in our Twitter Card Guide
- Recommended image size: 1200ร627px
- Professional context - focus on business value in descriptions
- Use the LinkedIn Post Inspector
- Read our LinkedIn optimization guide
Slack & Discord
- Follow standard OG protocol
- Discord shows color themes from
theme-colormeta tag - Both platforms cache aggressively (24+ hours)
Required Open Graph Tags
At minimum, you need these four tags for proper previews:
| Tag | Description | Example |
|---|---|---|
og:title | The title of your content | 60-70 characters max |
og:description | A brief description | 150-160 characters max |
og:image | URL to preview image | Must be absolute HTTPS URL |
og:url | Canonical URL of the page | Full URL with protocol |
Open Graph Image Best Practices
Your OG image is the most important visual element. Here's how to optimize it:
Dimensions & Size
- Recommended: 1200ร630px (1.91:1 aspect ratio)
- Minimum: 600ร315px
- File size: Under 1MB (ideally under 300KB)
- Format: JPG, PNG, or WebP
Design Tips
- Keep text large and readable (min 40px font size)
- Use high contrast colors
- Avoid placing important content near edges (safe zone: 100px margin)
- Include your brand/logo
- Test on mobile - many previews are viewed on phones
See our complete OG Image Size Guide for platform-specific recommendations.
Cache Busting & Debugging
After updating your OG tags, social platforms often show old cached versions. Here's how to force a refresh:
Debug Tools
- Facebook Sharing Debugger - Also clears cache
- Twitter Card Validator
- LinkedIn Post Inspector
- Our Open Graph Preview Tool - Test all platforms at once
Learn detailed cache refresh techniques in our Cache Refresh Guide.
Common Open Graph Mistakes
1. Using Relative Image URLs
โ <meta property="og:image" content="/images/og.jpg" />
โ
<meta property="og:image" content="https://example.com/images/og.jpg" />
2. Forgetting Image Dimensions
Always include width and height for better performance:
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />3. Client-Side Meta Tags (React/Vue/Nuxt)
Social media crawlers don't execute JavaScript! Use SSR (Server-Side Rendering) or static generation:
- Next.js: Use the Metadata API or
next-seo - Nuxt: Use
useSeoMeta()composable - Gatsby: Use
react-helmet
4. Not Testing Before Launch
Always preview your tags before publishing. Use our free preview tool to catch issues early.
Framework-Specific Implementation
Nuxt 3
// pages/index.vue
useSeoMeta({
ogTitle: 'Your Page Title',
ogDescription: 'Your description',
ogImage: 'https://example.com/og-image.jpg',
ogUrl: 'https://example.com',
twitterCard: 'summary_large_image'
})Next.js 14+
// app/page.tsx
export const metadata = {
openGraph: {
title: 'Your Page Title',
description: 'Your description',
images: ['https://example.com/og-image.jpg'],
url: 'https://example.com'
}
}React + Helmet
import { Helmet } from 'react-helmet-async'
<Helmet>
<meta property="og:title" content="Your Page Title" />
<meta property="og:description" content="Your description" />
<meta property="og:image" content="https://example.com/og-image.jpg" />
</Helmet>Complete Testing Workflow
- Implement tags in your framework using SSR/SSG
- Preview locally using our Open Graph Preview Tool
- Deploy to staging with HTTPS enabled
- Test with official debuggers (Facebook, Twitter, LinkedIn)
- Monitor real shares - check actual social posts
- Iterate based on engagement metrics (CTR, shares, etc.)
Additional Resources
Ready to preview your Open Graph tags?
Test how your links will appear on Facebook, Twitter, LinkedIn, Slack, Discord, and WhatsAppโall in one place.
Try the Free Preview Tool