📢developer

Open Graph Tags: Why Your Links Look Bad When Shared (And How to Fix It)

When someone shares your website on social media and the preview looks broken or generic, it's almost always an Open Graph problem. Here's the complete guide to OG tags.

PSBy Priya Shah · Senior Software EngineerDecember 9, 2025Updated February 1, 20266 min read
Free to read

Advertisement

Frequently Asked Questions

What is Open Graph and why does it matter?+
Open Graph (OG) is a protocol developed by Facebook that lets you control how your web pages appear when shared on social media platforms. When someone shares a link on Facebook, Twitter/X, LinkedIn, Slack, or WhatsApp, the platform fetches that page and reads its OG meta tags to determine the preview title, description, image, and other properties. Without OG tags, platforms fall back to guessing — often picking the wrong image, using a generic title, or showing a blank preview. OG tags let you specify exactly what the preview should look like.
What size should Open Graph images be?+
The recommended size is 1200×630 pixels (a 1.91:1 aspect ratio). Facebook and most other platforms use this ratio for the preview card. At minimum, images should be at least 600×315 pixels. Images smaller than 200×200 pixels may not display at all. Keep important content away from edges (a 50px safe zone on each side) because some contexts crop the sides. Use JPG or PNG format — WebP support varies across platforms. File size should stay under 1MB for reliable display. These dimensions work across Facebook, LinkedIn, Slack, and most messaging apps.
Twitter has its own card tags — do I need both?+
Twitter/X supports both Open Graph tags and its own Twitter Card tags. If Twitter Card tags are present, Twitter uses them and ignores OG tags. If Twitter Cards are absent, Twitter falls back to OG tags. For most sites, adding just the Twitter-specific tags in addition to OG tags is sufficient: twitter:card (set to 'summary_large_image' for a large image preview), twitter:title, twitter:description, and twitter:image. If your OG tags are already correct, you may only need to add twitter:card to get the large image preview. Twitter doesn't require OG tags on pages that have Twitter Card tags.

Advertisement

🔧 Free Tools Used in This Guide

PS

Priya Shah

Senior Software Engineer · 9+ years experience

Priya has nine years of experience building distributed systems and developer tooling at two B2B SaaS companies. She writes about APIs, JSON/JWT workflows, regex, DevOps, and the small utilities that make debugging faster at 2am.

View all posts by Priya Shah

Tags:

open-graphseosocial-mediameta-tagshtml