Open Graph Tags: Control How Your Pages Look When Shared
Open Graph (OG) tags are meta tags that control how your page appears in link previews on social networks and messaging apps. When someone shares your URL on LinkedIn, Facebook, Twitter/X, Slack, or iMessage, the platform fetches your OG tags to build the preview card. Without OG tags, platforms generate their own preview from whatever content they can find - which is often wrong.
Essential Open Graph Tags
The og:image is the most important tag for social sharing. Use a 1200x630px image (1.91:1 ratio) for best compatibility across platforms. Host the image on your own domain or a reliable CDN - never use a relative URL. The image must be accessible publicly, not behind authentication. Twitter/X also requires twitter:image if you want a large card.
Twitter Card Tags
Twitter reads og:* tags as a fallback but has its own twitter:* tags that take precedence. Set twitter:card to summary_large_image for the full-width image preview. If you only set OG tags, Twitter will use them, but results are more reliable with explicit twitter:* tags.
Article Open Graph Tags
For blog posts, add og:type of article and article-specific tags: article:published_time (ISO 8601 date), article:author (URL of author profile), article:section (category). These help LinkedIn and Facebook properly categorize your content and can improve how it displays in news-feed contexts.
Testing Open Graph Tags
Facebook provides the Sharing Debugger at developers.facebook.com/tools/debug. Enter your URL to see exactly how Facebook fetches and displays your OG tags, including any errors. LinkedIn has a Post Inspector at linkedin.com/post-inspector. Twitter has the Card Validator at cards-dev.twitter.com/validator. After updating OG tags, use these tools to refresh the cached preview - most platforms cache previews for hours or days.