Meta Tags Guide (Part 5): Open Graph, Social Cards and Share Previews
Build reliable social share previews with Open Graph metadata, images, canonical URLs and platform fallbacks without confusing social metadata with SEO.

A page can rank perfectly well in search and still look dreadful when somebody pastes it into Slack, LinkedIn, Facebook, Discord or another app.
That is because search metadata and social-preview metadata are related, but they are not the same system.
Search engines decide how a search result should look using several signals. Social platforms and messaging applications commonly look for Open Graph metadata and, depending on the platform, additional card metadata. If those values are missing, stale or contradictory, the consumer has to guess.
The practical goal is not to fill the <head> with every property ever invented. It is to give preview consumers a small, consistent description of the page: what it is called, what it is about, which URL represents it, and which image should represent it visually.
A sensible Open Graph baseline
For an ordinary article or landing page, start here:
<meta property="og:title" content="HTTP Security Headers: A Practical Guide">
<meta property="og:description" content="Configure CSP, HSTS, framing protection and other modern HTTP security headers correctly.">
<meta property="og:type" content="article">
<meta property="og:url" content="https://example.com/guides/http-security-headers/">
<meta property="og:image" content="https://example.com/images/http-security-headers-share.jpg">
<meta property="og:image:alt" content="Illustration representing HTTP security headers">
<meta property="og:site_name" content="Example">
The Open Graph protocol defines four basic properties: og:title, og:type, og:image and og:url. Properties such as og:description, og:site_name, locale information and structured image properties add useful context.
For most sites, that small set gets you surprisingly far.
og:title: write for the share, not for a keyword counter
A social title has a different job from a traditional SEO title.
It appears in a feed, chat window or card where the reader often has very little context. It therefore needs to make sense on its own.
Bad:
<meta property="og:title" content="Part 5 | Example">
Better:
<meta property="og:title" content="Open Graph Metadata That Produces Better Share Previews">
The second title tells a human what they are about to open.
You do not have to make og:title identical to <title>. In many cases keeping them similar is operationally simpler, but there are legitimate reasons to make the social version slightly more conversational.
What you should avoid is allowing the two to describe materially different pages. Metadata should clarify the content, not manufacture a different promise around it.
og:description: a preview, not a miniature essay
The description should make the card understandable without repeating the title word for word.
<meta property="og:description"
content="Learn how Open Graph titles, descriptions, URLs and images work together — and how to debug broken social previews.">
Do not obsess over an exact universal character count. Different products have different card layouts, widths and truncation behaviour.
Put the useful information early and make the sentence survive truncation gracefully.
That same principle applies to ordinary meta descriptions.
og:url: choose the identity of the page deliberately
Open Graph defines og:url as the permanent URL representing the object.
For a normal canonical page, it will usually agree with your canonical URL:
<link rel="canonical" href="https://example.com/guides/open-graph/">
<meta property="og:url" content="https://example.com/guides/open-graph/">
That consistency matters operationally. You do not want your SEO system claiming one URL represents the content while your social metadata claims another.
Be especially careful with:
- UTM parameters;
- preview URLs;
- staging hostnames;
- session IDs;
- filtered URLs;
- HTTP/HTTPS variants;
- trailing-slash inconsistencies.
A CMS that blindly writes window.location.href into og:url can turn campaign URLs into separate social identities.
The share image is often the most important part of the card
A technically valid page with a poor image can still create a weak preview.
Use an image that:
- is actually relevant to the page;
- remains understandable when cropped;
- does not depend on tiny text;
- is publicly fetchable;
- has a stable HTTPS URL;
- returns the correct image content type;
- is large enough to survive high-density displays.
Open Graph also supports structured properties such as:
<meta property="og:image" content="https://example.com/share/security.jpg">
<meta property="og:image:secure_url" content="https://example.com/share/security.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Browser window with security controls around it">
The width and height are metadata about the asset. They do not resize the image for you.
Do not put critical information at the extreme edges
Preview consumers may crop differently.
If the entire meaning of the image depends on a logo or sentence touching the edge, one platform’s crop can destroy it.
Treat the centre of the artwork as the safest visual area and test the actual result rather than assuming your design file represents every card layout.
og:image:alt deserves more attention
The Open Graph specification says that when og:image is supplied, og:image:alt should also be supplied.
It should describe what the image contains rather than duplicate the article title mechanically.
For example:
<meta property="og:image:alt"
content="Diagram showing a web page supplying metadata to social platforms">
That is more useful than:
<meta property="og:image:alt" content="Meta Tags Guide Part 5">
Absolute URLs remove avoidable ambiguity
For preview metadata, prefer absolute image and page URLs:
<meta property="og:image" content="https://example.com/images/share.jpg">
rather than:
<meta property="og:image" content="/images/share.jpg">
A browser can resolve the second form easily. External preview crawlers are not where you want to rely on unnecessary assumptions.
Social metadata is not a substitute for normal metadata
This is an important distinction.
Do not replace:
<title>...</title>
<meta name="description" content="...">
<link rel="canonical" href="...">
with Open Graph equivalents.
They serve different consumers and different purposes.
A robust page can have all of them:
<title>Open Graph Metadata: A Practical Guide | Example</title>
<meta name="description" content="Create reliable social previews with Open Graph titles, descriptions, URLs and images.">
<link rel="canonical" href="https://example.com/guides/open-graph/">
<meta property="og:title" content="Open Graph Metadata That Produces Better Share Previews">
<meta property="og:description" content="A practical guide to titles, descriptions, URLs, images and preview debugging.">
<meta property="og:type" content="article">
<meta property="og:url" content="https://example.com/guides/open-graph/">
<meta property="og:image" content="https://example.com/images/open-graph-share.jpg">
What about X/Twitter card metadata?
Some platforms support their own card vocabulary in addition to, or as a fallback around, Open Graph metadata.
A commonly deployed pattern is:
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Open Graph Metadata That Produces Better Share Previews">
<meta name="twitter:description" content="A practical guide to reliable social cards.">
<meta name="twitter:image" content="https://example.com/images/open-graph-share.jpg">
The operational lesson is more important than memorising a giant list of tags: decide which platforms matter to your audience, implement their current supported metadata, and test actual previews.
Do not cargo-cult ten-year-old snippets from blog posts simply because they contain more tags.
Avoid metadata drift
One of the most common production problems is not missing metadata. It is metadata generated by different systems.
Imagine this page:
<title> = Blue Widget Guide
canonical = /guides/blue-widget/
og:title = Red Widget Guide
og:url = /blog/widget-old/
og:image = old campaign artwork
Every individual tag is syntactically valid. Collectively, the page is a mess.
A better architecture creates a single page metadata model:
const metadata = {
title: 'Blue Widget Guide',
description: 'How to choose and configure blue widgets.',
canonicalUrl: 'https://example.com/guides/blue-widget/',
shareImage: 'https://example.com/images/blue-widget-share.jpg'
}
Then derive the appropriate HTML, Open Graph and platform-specific values from it.
This dramatically reduces contradictory metadata at scale.
CMS previews should not be trusted blindly
A CMS may show a beautiful internal preview while the public page is broken.
The external crawler sees the deployed response, not the CMS editor.
Check:
- the raw/public HTML;
- the final public URL;
- the image response;
- redirects;
- robots restrictions;
- authentication or WAF rules;
- the platform’s actual preview/debugging tool where available.
JavaScript-only metadata is a risky dependency for sharing
If important social tags appear only after client-side JavaScript runs, a preview crawler that does not execute your application in the same way as a browser may miss them.
For SSR, SSG and hybrid applications, generate share metadata in the server-rendered/document HTML whenever practical.
This is particularly important for dynamic product, article and profile routes where every URL needs different metadata.
A single client-side default such as:
<meta property="og:title" content="My Website">
across ten thousand pages is not meaningful metadata.
Dynamic social images can be excellent — if they fail safely
Programmatically generated Open Graph images are useful for large content libraries.
They can incorporate:
- article title;
- product name;
- category;
- author;
- brand treatment;
- relevant illustration.
But image generation becomes part of your publishing infrastructure.
Plan for:
- long titles;
- missing fonts;
- non-Latin text;
- emoji;
- broken remote images;
- generation timeouts;
- caching;
- invalidation when a title changes;
- a dependable fallback asset.
A broken dynamic-image endpoint can degrade previews across an entire site at once.
Do not confuse social shares with canonicalisation
og:url is useful metadata for social consumers. It is not a replacement for rel="canonical" in your search canonicalisation strategy.
Likewise, a perfect Open Graph image does not improve an indexing problem, and twitter:card does not tell Google which duplicate URL should be canonical.
Keep the responsibilities separate even if one metadata service generates them together.
Troubleshooting a broken share preview
When a preview looks wrong, work from the outside in.
1. Fetch the public URL
Confirm the page returns the response you expect without your logged-in browser state.
2. Inspect the actual HTML
Search for:
og:title
og:description
og:url
og:image
Check for duplicate values as well as missing ones.
3. Fetch the image directly
Verify that it:
- returns successfully;
- is actually an image;
- does not require cookies;
- is not blocked by a CDN or hotlink rule;
- is not redirecting to an authentication page.
4. Check stale caches
Social platforms commonly cache preview information. Correcting the HTML does not necessarily mean every previously cached preview changes instantly.
Use the platform’s current re-scrape/debug facility where one exists.
5. Check the production renderer
For dynamic sites, inspect whether the metadata being generated for bots is actually route-specific.
A common failure is a frontend that updates the browser tab after hydration while the original document still contains generic metadata.
Is your page metadata internally consistent?
Run a SiteTidy audit and catch public-page metadata problems before treating a broken preview as a mysterious platform bug.
A production checklist
Before shipping a page template, verify that:
- the normal
<title>is correct; - the meta description describes the real page;
- the canonical URL is correct;
og:titleis meaningful;og:descriptionis useful;og:typeis appropriate;og:urlidentifies the intended page;og:imageis absolute, stable and publicly accessible;- the share image survives cropping;
og:image:altdescribes the image;- platform-specific card metadata is present where you deliberately support it;
- staging domains cannot leak into production metadata;
- dynamic routes generate route-specific values;
- preview images have a fallback;
- duplicate/conflicting tags are not being emitted by multiple plugins;
- the deployed page has been tested outside the CMS preview.
The principle to remember
Social metadata is packaging.
It cannot rescue a bad article, fix a canonicalisation problem or make an irrelevant page rank. What it can do is ensure that when a good page is shared, the person receiving the link sees a clear title, useful description, correct URL and compelling visual rather than whatever an external crawler managed to guess.
That is worth doing properly — and it only takes a small, disciplined metadata model to make it reliable.
