What Is OpenGraph and Why It Matters
When you share a link on Facebook, Twitter, LinkedIn, Slack, or WhatsApp, those platforms don't just show a URL — they show a rich preview card with an image, title, and description. That preview is driven by OpenGraph meta tags in your page's <head>.
First introduced by Facebook in 2010, OpenGraph (OG) is now the de-facto standard for how websites communicate their identity to social platforms. Getting these tags right is the difference between:
- A rich, compelling link preview that gets clicked ✅
- A blank card with just a URL that gets ignored ❌
The Essential OpenGraph Tags
<!-- The most important OG tags -->
<meta property="og:title" content="Your Page Title Here" />
<meta property="og:description" content="A compelling 155-character description." />
<meta property="og:image" content="https://yoursite.com/og-image.png" />
<meta property="og:url" content="https://yoursite.com/page" />
<meta property="og:type" content="website" />
<!-- Twitter-specific (Twitter Card) -->
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="Your Page Title Here" />
<meta name="twitter:description" content="A compelling description for Twitter." />
<meta name="twitter:image" content="https://yoursite.com/og-image.png" />
Platform Requirements & Best Practices
| Platform | Recommended Image Size | Aspect Ratio | Min Size |
|---|
| Facebook | 1200 × 630px | 1.91:1 | 600 × 315px |
| Twitter | 1200 × 675px | 16:9 (large card) | 300 × 157px |
| LinkedIn | 1200 × 627px | ~1.91:1 | 1200 × 627px |
| WhatsApp | 300 × 200px min | Any | 200 × 200px |
Image format: PNG or JPG. PNG is safer for graphics with text; JPG for photographs.
Image file size: Under 5MB for Facebook's scraper; under 1MB recommended for fast loading.
Title length: Keep under 60–70 characters to avoid truncation on most platforms.
Description length: 155 characters max is the sweet spot across all platforms.
Why Your Preview Might Look Wrong
Cached old data: Every social platform caches OG data aggressively. Even after you update your tags, the old preview may persist for hours. Use each platform's cache-clearing tool (Facebook Debugger, Twitter Card Validator) to force a fresh crawl.
og:image requires an absolute URL. A relative path like /images/og.png won't work — scrapers don't have context. Use `https://yourdomain.com/images/og.png...
Looking for a more detailed deep-dive and advanced tips?
Read Full Article on our Blog