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.

๐Ÿ“… Updated December 2025โฑ๏ธ 15 min read

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:card tags
  • Recommended image size: 1200ร—675px (summary_large_image)
  • Requires twitter:card to be set (usually "summary_large_image")
  • Learn more in our Twitter Card Guide

LinkedIn

Slack & Discord

  • Follow standard OG protocol
  • Discord shows color themes from theme-color meta tag
  • Both platforms cache aggressively (24+ hours)

Required Open Graph Tags

At minimum, you need these four tags for proper previews:

TagDescriptionExample
og:titleThe title of your content60-70 characters max
og:descriptionA brief description150-160 characters max
og:imageURL to preview imageMust be absolute HTTPS URL
og:urlCanonical URL of the pageFull 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

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

  1. Implement tags in your framework using SSR/SSG
  2. Preview locally using our Open Graph Preview Tool
  3. Deploy to staging with HTTPS enabled
  4. Test with official debuggers (Facebook, Twitter, LinkedIn)
  5. Monitor real shares - check actual social posts
  6. 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