Complete Open Graph Guide

Everything you need to know about Open Graph protocol for social media link previews.

Updated January 2026 5 min
LR

Logan Renz

• Developer

Comprehensive Open Graph implementation guide based on official platform documentation.

Full-Stack Developer LinkedIn Profile
Published: November 15, 2025 Updated: January 11, 2026

What is Open Graph?

Open Graph (OG) is a protocol created by Facebook in 2010 that controls how web pages appear when shared on social media. It uses HTML meta tags in your page's <head> section.

html
<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>

Required Tags

At minimum, include these four tags:

TagDescription
og:titlePage title (60-70 chars)
og:descriptionBrief description (150-160 chars)
og:imageAbsolute HTTPS image URL
og:urlCanonical page URL

Image Best Practices

Universal Image Size

1200 × 630 pixels (1.91:1 ratio)

Works on Facebook, LinkedIn, Slack, Discord, Telegram, WhatsApp, iMessage. Keep under 1MB, use JPG or PNG.

Platform-specific differences:

  • Twitter: Prefers 1200×675px (16:9 ratio) for large cards
  • LinkedIn: Uses 1200×627px (slightly different)
  • WhatsApp: Strict 300KB file size limit

Common Mistakes

❌ Relative URLs

/images/og.jpg → Use https://example.com/images/og.jpg

❌ Client-side only tags

Social crawlers don't run JavaScript. Use SSR/SSG.

❌ Missing image dimensions

Add og:image:width and og:image:height for faster loading.

Framework Examples

Nuxt 3

javascript
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+

javascript
export const metadata = {
  openGraph: {
    title: 'Your Page Title',
    description: 'Your description',
    images: ['https://example.com/og-image.jpg'],
    url: 'https://example.com'
  }
}

Debugging Tools

Official Resources

Test Your OG Tags

Preview how your links appear on Facebook, Twitter, LinkedIn, and 5 more platforms.

Open Preview Tool