Open Graph Tags: How to Control Link Previews

When a link is shared on Facebook, LinkedIn, WhatsApp, Slack or X, a few lines in the page's head decide which title, text and picture people see.

Paste a link into a chat or a post and, a moment later, a card appears with a picture, a headline and a line of text. That card is not guessed from the page: it is built from Open Graph tags, a handful of meta elements in the page's <head>. Pages without them get whatever the network can scrape, which is often the logo, a cookie banner or no picture at all. This guide explains the tags that matter, the image rules and how to fix a preview that will not update.

What Open Graph is

Open Graph is a small set of conventions introduced by Facebook in 2010 so that any web page could describe itself when shared. It caught on far beyond Facebook: LinkedIn, WhatsApp, Telegram, Slack, Discord, Microsoft Teams and many others read the same tags. X reads them too, alongside its own twitter: tags. Writing them once therefore covers nearly every place a link can be shared.

The tags look like this:

<meta property="og:type" content="article">
<meta property="og:title" content="How to Make Cold Brew at Home">
<meta property="og:description" content="The grind, the ratio and the steeping time.">
<meta property="og:url" content="https://example.com/cold-brew">
<meta property="og:image" content="https://example.com/images/cold-brew.jpg">
<meta property="og:site_name" content="The Coffee Blog">

The tags that matter

TagWhat it setsAdvice
og:titleThe bold headline of the cardCan differ from the search title: shorter and more inviting
og:descriptionThe line under the headlineOne or two sentences; many apps show only the first line
og:imageThe pictureA full https:// address; see the size rules below
og:urlThe address the share counts forThe canonical address, without tracking parameters
og:typeThe kind of pagewebsite for most pages, article for posts
og:site_nameThe site shown above or below the titleYour brand name
og:localeThe language and regionSuch as en_US; optional

Note that Open Graph uses property, not name. Most platforms accept either, but property is what the specification says.

The image: size and format

The image is what people notice first, and it is where most previews go wrong.

  • Size: 1200 × 630 pixels, a ratio of 1.91 to 1, works everywhere. Images smaller than 600 × 315 may be shown as a small thumbnail or dropped.
  • Format: JPG or PNG are safe. WebP is accepted by most but not all platforms; GIFs are shown as a still image.
  • File size: keep it well under a few megabytes. Some apps, WhatsApp in particular, skip heavy images.
  • Address: an absolute https:// address that anyone can open. Relative paths, images behind a login and addresses blocked by robots.txt do not work.
  • Safe area: keep text and faces away from the edges, since some apps crop the image to a square or a narrower strip.

The image converter resizes and compresses an image to these dimensions without uploading it.

X (Twitter) cards

X reads Open Graph tags for the title, description and image, but one decision needs its own tag: twitter:card. With summary_large_image, the picture is shown wide above the text; with summary, it is a small square beside it. Without the tag, links may appear as a plain URL. twitter:site can name the account behind the site. The Twitter card generator writes both sets of tags together.

Open Graph and search engines

Search engines do not rank pages by their Open Graph tags; the <title> element and the meta description shape the search result instead. The two sets often carry similar text, but they serve different readers: the search title should contain the words people search for, while the share title can be written for someone scrolling a feed. The Google search preview shows how the search version looks.

Why a preview is wrong or missing

SymptomLikely causeFix
Old image or text after a changeThe platform cached the first previewAsk it to re-read the page, for example with the Facebook Sharing Debugger or LinkedIn Post Inspector
No image at allRelative or unreachable image addressUse a full public https:// address
Tiny thumbnail instead of a wide pictureImage too small, or no twitter:card on XUse 1200 × 630 and add summary_large_image
The wrong titleTags added by JavaScript after the page loadsPut the tags in the HTML the server sends; most crawlers do not run scripts
Nothing on one page onlyThe page blocks bots or needs a loginAllow the crawler to fetch the page

The JavaScript point catches many single-page apps: if the tags only appear after scripts run, the crawlers of social networks never see them. Render them on the server, or pre-render the pages that are shared most.

Writing the tags

The Meta Tag Generator writes the search tags, the Open Graph tags and the X tags from one short form, with previews for Google, Facebook and X that update as you type. It can also read the tags of an existing page from its HTML, which is the quickest way to audit a page you already have. The Open Graph generator opens it with the social preview in focus.

Frequently Asked Questions

What are Open Graph tags?

Meta tags in a page's head, such as og:title, og:description and og:image, that tell social networks and chat apps what title, text and picture to show when the page is shared.

What size should an og:image be?

1200 by 630 pixels, at a ratio of 1.91 to 1. That size works on Facebook, LinkedIn, WhatsApp and in the large X card.

Why does Facebook show an old picture?

It cached the preview the first time the link was shared. Use the Facebook Sharing Debugger to make it read the page again.

Do Open Graph tags help SEO?

Not directly. Search results use the title element and the meta description, but good share previews bring more clicks from social media.

Do I need Twitter tags if I have Open Graph?

X falls back to Open Graph for text and image, but add twitter:card so the link shows as a large image card.