A Comprehensive Guide to Open Graph Meta Tags

Open Graph meta tags are essential for controlling how your content appears when shared on social media platforms. This guide covers everything you need to know about implementing Open Graph tags effectively.

Basic Required Tags

Essential Open Graph Tags

These four tags must be included on every page for proper social media sharing

Tag
Purpose
Example
og:title
The title of your page
<meta property="og:title" content="Page Title" />
og:description
Brief description (1-2 sentences)
<meta property="og:description" content="Page description..." />
og:image
Absolute URL to preview image
<meta property="og:image" content="https://example.com/image.jpg" />
og:url
Canonical URL of the page
<meta property="og:url" content="https://example.com/page" />

Image Requirements

Technical Requirements

  • Size1200 x 630 pixels (Recommended)
  • File SizeLess than 5MB (ideally few hundred KB)
  • FormatJPG, PNG, or GIF

Additional Image Tags

<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Description of image" />

Implementation Guide

Open Graph Implementation

Basic Open Graph tags implementation

<!-- Basic Open Graph Tags -->
<meta property="og:title" content="A Guide to Open Graph Meta Tags" />
<meta property="og:description" content="Learn how to implement Open Graph meta tags for better social media sharing." />
<meta property="og:image" content="https://example.com/og-image.jpg" />
<meta property="og:url" content="https://example.com/guide" />

<!-- Optional but Recommended -->
<meta property="og:type" content="article" />
<meta property="og:locale" content="en_US" />
<meta property="og:site_name" content="Your Site Name" />

<!-- Image Specifications -->
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="Open Graph Guide Cover Image" />

Platform-Specific Considerations

Facebook

  • • Minimum image size: 200 x 200 pixels
  • • Recommended aspect ratio: 1.91:1
  • • Images are cropped to 1.91:1 in feeds
  • • Maximum file size: 8MB

Twitter/X

  • • Minimum size for summary_large_image: 300 x 157 pixels
  • • Maximum image size: 5MB
  • • Supported formats: JPG, PNG, WEBP, GIF
  • • No animated GIFs in cards

LinkedIn

  • • Recommended image size: 1200 x 627 pixels
  • • Minimum image size: 200 x 200 pixels
  • • Maximum file size: 5MB
  • • Title length: 70 characters
  • • Description length: 100 characters

Best Practices