What Are Open Graph Tags?
Open Graph is a protocol Facebook announced in 2010 that lets any web page become a rich "object" in a social graph. The core idea was simple: add a handful of HTML meta tags to your page's <head> and Facebook would use them to build a proper link card instead of guessing.
The tags look like this:
<meta property="og:title" content="My Amazing Article">
<meta property="og:description" content="A short description of the article.">
<meta property="og:image" content="https://example.com/og-image.png">
<meta property="og:url" content="https://example.com/my-amazing-article">
Notice the property attribute, not name. That's the first thing developers get wrong. Standard meta tags use name; OG tags use property. If you use name="og:title", some platforms will still read it, but others won't.
The protocol spread fast. LinkedIn, Pinterest, Twitter, WhatsApp, iMessage, Slack, Discord — they all adopted OG tags as the standard way to read link metadata. Today, putting OG tags on your page is as fundamental as setting a <title>.
All of these read og: tags when someone pastes your URL.
property="og:...". Twitter Card tags use name="twitter:...". This distinction matters — mixing them up is one of the most common reasons tags are silently ignored.The Core Four OG Tags
Every page should have at minimum these four:
<!-- Required for every page -->
<meta property="og:type" content="website">
<meta property="og:title" content="Your Page Title">
<meta property="og:description" content="One or two sentences about this page.">
<meta property="og:image" content="https://example.com/og-image.png">
<meta property="og:url" content="https://example.com/your-page">
og:type defaults to website for most pages. og:title should be your page's social-facing title — it can differ slightly from your HTML <title> tag. og:url should be the canonical URL, exactly matching your <link rel="canonical"> tag.
The og:image — The Tag That Actually Makes the Difference
Of all the OG tags, og:image has the most impact on click-through rates. A good share image can double the engagement on a post. A missing or broken one drops it off a cliff.
Image specifications by platform
| Platform | Ideal size | Min size | Aspect ratio | Max file size |
|---|---|---|---|---|
| 1200×630 px | 200×200 px | 1.91:1 | 8 MB | |
| Twitter (large) | 1200×628 px | 300×157 px | 1.91:1 | 5 MB |
| 1200×627 px | 200×200 px | 1.91:1 | 5 MB | |
| 1200×630 px | 300×200 px | Any | — | |
| Slack | 1200×630 px | 150×150 px | Any | — |
The practical answer: make one 1200×630 px image and it works everywhere. Provide explicit width and height tags alongside it so platforms don't need to download the image just to know its dimensions:
<meta property="og:image" content="https://example.com/og.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Alt text for screen readers">
<meta property="og:image:type" content="image/png">
/images/og.png won't work — platforms fetch your image server-side and need the full URL including the protocol and domain. https://example.com/images/og.png is correct.What to put in the image
Your OG image is essentially an ad for your link. Some proven approaches:
- Article title in large text on a branded background — works for blog posts
- Product screenshot or demo — works for tools and apps
- Bold stat or headline — works for data-heavy pages
- Your site logo + article category — minimal but consistent across all posts
Avoid putting important content in the corners or very bottom — Facebook and some platforms overlay UI elements there. Keep a safe zone of at least 50–60 pixels from each edge.
The og:type Property and What It Unlocks
The og:type tag tells platforms what kind of content your page represents. The default is website, but setting it to article unlocks a whole extra set of properties:
| Type value | Used for | Extra properties unlocked |
|---|---|---|
website | Homepages, general pages | None |
article | Blog posts, news, documentation | article:published_time, article:author, article:section, article:tag |
product | E-commerce product pages | Used with Pinterest rich pins |
profile | User / author profile pages | profile:first_name, profile:last_name, profile:username |
video.other | Video pages | og:video, og:video:width, og:video:height, og:video:type |
music.song | Music tracks | Music-specific OG properties |
Article Properties — the Hidden SEO Boost
When you set og:type to article, you can add article-specific metadata that Facebook and some news aggregators actually parse. This is especially useful for content sites and blogs:
<!-- Set type to article first -->
<meta property="og:type" content="article">
<!-- Then add article-specific properties -->
<meta property="article:published_time" content="2026-06-06T10:00:00Z">
<meta property="article:modified_time" content="2026-06-06T12:00:00Z">
<meta property="article:author" content="Jane Smith">
<meta property="article:section" content="Technology">
<!-- One meta element per tag -->
<meta property="article:tag" content="SEO">
<meta property="article:tag" content="Open Graph">
<meta property="article:tag" content="Meta Tags">
Note that article:tag is one element per tag, not a comma-separated list. Dates should be ISO 8601 format. The article:author can be either a plain text name or a URL pointing to the author's profile.
Twitter Cards vs Open Graph
Twitter/X introduced its own tagging system called Twitter Cards, which uses name attributes instead of property. The key insight is that Twitter falls back to OG tags for title, description, and image if twitter-specific tags aren't present — but you need twitter:card at minimum to control the card layout.
Twitter Card types
| Card type | Layout | Best for |
|---|---|---|
summary_large_image | Full-width image above content | Blog posts, news, marketing pages |
summary | Small thumbnail beside text | General pages, profiles, homepages |
app | App download card with ratings | Mobile app pages |
player | Embedded video/audio player | Media pages (requires approval) |
For most content, summary_large_image is what you want. The full set of Twitter Card tags looks like this:
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@yoursite">
<meta name="twitter:creator" content="@authorhandle">
<!-- These are optional — Twitter falls back to og: if omitted -->
<meta name="twitter:title" content="Override title for Twitter">
<meta name="twitter:description" content="Override description for Twitter">
<meta name="twitter:image" content="https://example.com/twitter-image.png">
<meta name="twitter:image:alt" content="Alt text for the image">
A Complete Production Head Section
Here's everything together in the order you should place it, for an article page:
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>How Open Graph Tags Work | My Blog</title>
<meta name="description" content="A 160-char SEO description for search results.">
<link rel="canonical" href="https://example.com/blog/og-tags">
<!-- Open Graph -->
<meta property="og:type" content="article">
<meta property="og:title" content="How Open Graph Tags Work">
<meta property="og:description" content="150–200 char description for social cards.">
<meta property="og:url" content="https://example.com/blog/og-tags">
<meta property="og:site_name" content="My Blog">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://example.com/og.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Alt text for the image">
<!-- Article properties -->
<meta property="article:published_time" content="2026-06-06T10:00:00Z">
<meta property="article:author" content="Jane Smith">
<meta property="article:tag" content="SEO">
<meta property="article:tag" content="Open Graph">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@myblog">
</head>
Generate your OG tags right now
Fill in a form, see live Facebook/Twitter/LinkedIn previews, copy the HTML in one click.
Debugging OG Tags — Why Your Change Isn't Showing
You've updated your tags, deployed, pasted the URL on Facebook — and the old image is still there. This is almost always a caching problem. Social platforms crawl your page and cache the result heavily. After a change, you have to force each platform to re-scrape your URL.
| Platform | Debugger / Inspector | How to refresh |
|---|---|---|
| developers.facebook.com/tools/debug | Paste URL, click "Scrape Again" (may need to do it 2–3 times) | |
| linkedin.com/post-inspector | Paste URL, click Inspect — it fetches fresh data immediately | |
| Twitter/X | cards-dev.twitter.com/validator | Paste URL, click "Preview Card" to re-fetch |
| developers.pinterest.com/tools/url-debugger | Paste URL and submit |
Common mistakes that break OG tags
- Using relative URLs for og:image — platforms fetch images server-side and need absolute URLs with https://
- Using
nameinstead ofpropertyon OG tags — silently ignored by many platforms - Image behind login or IP restriction — platforms can't fetch private images
- og:url doesn't match the canonical URL — causes deduplication issues in Facebook's object graph
- No og:image at all — platforms fall back to the first
<img>on the page, which is usually your logo or a tiny icon - Image too small — anything smaller than 600×315 on Facebook won't render as a large card
- Tags in the body, not the head — some platforms stop reading meta tags once they encounter the
</head>tag - Duplicate og:title tags — some platforms take the first one, others take the last; be explicit and have only one
Video and Audio OG Properties
If your page features embedded video or audio content, you can add og:video and og:audio tags. These are used by Facebook for native video previews and by some platforms to render inline playback.
<!-- Video OG -->
<meta property="og:video" content="https://example.com/video.mp4">
<meta property="og:video:width" content="1280">
<meta property="og:video:height" content="720">
<meta property="og:video:type" content="video/mp4">
<!-- Audio OG -->
<meta property="og:audio" content="https://example.com/podcast.mp3">
<meta property="og:audio:type" content="audio/mpeg">
In practice, native video OG rendering is only available to publishers approved by Facebook for Instant Articles or video distribution. For most sites, these tags are a nice signal but won't change the visual rendering.
Setting OG Tags in CMS Platforms
You don't always edit HTML directly. Here's how OG tags work in the most common platforms:
WordPress (Yoast SEO / Rank Math)
Yoast SEO and Rank Math both auto-generate OG tags from your post title, excerpt, and featured image. Go to the post editor → SEO plugin panel → Social tab to set custom OG title, description, and image that differ from the SEO fields. The featured image is used as og:image automatically.
Next.js App Router
// app/blog/og-tags/page.tsx
export const metadata = {
openGraph: {
title: 'How Open Graph Tags Work',
description: 'Your social share description here.',
url: 'https://example.com/blog/og-tags',
siteName: 'My Blog',
images: [{ url: 'https://example.com/og.png', width: 1200, height: 630, alt: 'Alt text' }],
type: 'article',
publishedTime: '2026-06-06T10:00:00Z',
authors: ['Jane Smith'],
},
twitter: {
card: 'summary_large_image',
site: '@myblog',
},
};
Shopify
Edit your theme's theme.liquid. Shopify exposes page_title, page_description, and page.featured_image objects you can use in the <head>:
<meta property="og:title" content="{{ page_title }}">
<meta property="og:description" content="{{ page_description | escape }}">
{% if page.featured_image %}
<meta property="og:image" content="https:{{ page.featured_image | img_url: '1200x630' }}">
{% endif %}
OG Tags vs SEO Meta Tags — What's the Difference?
A common point of confusion: OG tags and standard SEO meta tags exist side by side and serve different audiences.
| Tag | Read by | Affects |
|---|---|---|
<title> | Google, Bing, browsers | Search result title, browser tab |
meta name="description" | Google, Bing | Search result snippet text |
meta property="og:title" | Facebook, LinkedIn, WhatsApp, Slack | Social share card title |
meta property="og:description" | Facebook, LinkedIn, WhatsApp, Slack | Social share card description |
meta name="twitter:card" | Twitter/X | Twitter link card layout |
You need all of them. Google doesn't look at OG tags for ranking (though it may use them as signals for Knowledge Graph). Facebook doesn't look at the standard meta description. Set both sets of tags independently, even if the content is identical — it gives each platform exactly what it expects.
Quick Audit Checklist
Before shipping any page, run through this list:
- ✅
og:titleset withpropertyattribute (notname) - ✅
og:descriptionbetween 150–200 characters - ✅
og:imageis an absolute URL (starts withhttps://) - ✅
og:image:widthandog:image:heightpresent - ✅
og:image:altpresent for accessibility - ✅
og:urlmatches canonical URL - ✅
og:typecorrect —articlefor posts,websitefor general pages - ✅
twitter:cardset (at minimum) - ✅ Tested in Facebook Sharing Debugger after deploy
- ✅ Tested in LinkedIn Post Inspector