<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Outfit:wght@600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap">
🔍 SEO guide

Open Graph and Twitter Card Tags: How to Control Link Previews

Set up og:title, og:image and twitter:card tags so shared links look right on Facebook, LinkedIn, X and Slack, and fix stale or missing previews.

📅 Published 2026-11-15⏱️ 5 min read🛠️ 5 free tools

When someone pastes your link into Facebook, LinkedIn, X, WhatsApp, Slack or Discord, the platform fetches the page and builds a preview card: a title, a short description, an image and the domain. It builds that card from Open Graph tags, and on X from Twitter Card tags. If the tags are missing, the platform guesses, and the guess is often the cookie banner text and a logo cropped in half.

This guide explains which tags matter, the image sizes that work across platforms, why previews go stale after you fix them, and the single most common reason tags are present in your code but invisible to crawlers.

The tags every shareable page needs

Open Graph started at Facebook and is now read by almost every platform that unfurls links. Five properties cover nearly all cases. They use the property attribute, not name, although most parsers accept either.

  • og:title: the headline on the card. It can be shorter and punchier than your SEO title, and does not need the brand suffix.
  • og:description: one or two sentences. Some platforms, LinkedIn among them, often do not display it, so do not rely on it to carry the message.
  • og:image: the absolute URL of the preview image. This is the tag that most affects whether a post gets noticed.
  • og:url: the canonical URL of the page, so shares of different URL variants (with tracking parameters, for example) are counted together.
  • og:type: website for most pages, article for blog posts and news. og:site_name adds your brand name to the card on some platforms.
<meta property="og:type" content="article">
<meta property="og:site_name" content="Acme">
<meta property="og:title" content="How We Cut Our Build Time by 60%">
<meta property="og:description" content="The three changes that took our CI pipeline from 14 minutes to under 6.">
<meta property="og:url" content="https://www.example.com/blog/faster-builds">
<meta property="og:image" content="https://www.example.com/images/og/faster-builds.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Bar chart comparing build times before and after">

<meta name="twitter:card" content="summary_large_image">

Twitter Card tags and how X falls back

X reads its own twitter: tags, but falls back to Open Graph for title, description and image when the twitter: versions are missing. The one tag with no Open Graph equivalent is twitter:card, which sets the layout. Without it, X typically shows a small summary card, or just a plain link.

In practice you only need twitter:card plus your Open Graph tags. Add twitter:title or twitter:image only when you want different copy or a different crop on X.

  • summary: small square thumbnail beside the text. Good for profile or utility pages where the image is a logo.
  • summary_large_image: full-width image above the text. The right choice for articles, products and campaigns.
  • player and app: special card types for embedded media and app installs, which need extra tags and approval.
  • twitter:site and twitter:creator name the publisher and author accounts. They are optional.

Image size, format and aspect ratio

A 1200 × 630 pixel image (an aspect ratio of about 1.91:1) is the safe default. Facebook, LinkedIn, Slack and the X large card all display it well, and smaller platforms scale it. Images below roughly 600 pixels wide may be shown as a small thumbnail instead of a large card, and square images get cropped top and bottom on wide layouts.

Keep the important content in the middle of the frame, because each platform crops slightly differently and some overlay the domain or a play button. Large text in the image should stay at least 60 pixels from every edge.

  • Use JPG or PNG. WebP is supported by many platforms now, but not all link unfurlers, so a JPG is the safer bet for the og:image itself.
  • Keep the file small, ideally under a few hundred kilobytes. Platforms fetch the image with a short timeout, and very large files (several megabytes) may be skipped.
  • Declare og:image:width and og:image:height so the first share can render the image before the platform has downloaded it.
  • Add og:image:alt so the image has a text description for screen-reader users on platforms that support it.
  • Give each important page its own image. A single site-wide logo makes every share look the same.

Absolute URLs and pages crawlers can reach

og:image and og:url must be absolute URLs with the scheme: https://www.example.com/og.png, not /og.png or //cdn.example.com/og.png. Relative URLs are silently ignored by several platforms. The image must also be publicly reachable: not behind a login, not blocked by robots.txt for the platform crawler, and not served only to certain countries.

The biggest pitfall is client-side rendering. Social crawlers download the raw HTML and read the head; they do not run JavaScript. If your single-page app adds meta tags in the browser after the page loads, the crawler never sees them, and every page on your site shares whatever default tags are in index.html. The fix is to put the tags in the HTML the server sends, through server-side rendering, pre-rendering at build time, or an edge function that injects tags per route. View the page source (not the inspector, which shows the live DOM) to confirm the tags are there.

Fixing stale previews

Platforms cache previews aggressively, often for days or weeks. If a link was shared before you fixed its tags, the old title and image keep appearing even though your HTML is now correct. The cache is per URL, so the fix has to be applied to that URL on each platform.

  • Facebook, Instagram and WhatsApp: open the Sharing Debugger, enter the URL and click Scrape Again. It also lists warnings such as a missing og:image or an image that was too small.
  • LinkedIn: the Post Inspector fetches the URL fresh and shows the tags it found. Posts already published may still show the old card.
  • X: there is no public debugger any more. The card updates when the cache expires; changing the URL slightly, for example with a query parameter, forces a fresh fetch.
  • Slack and Discord: the unfurl cache usually expires within about a day. Re-posting with a query string forces a new fetch sooner.
  • If the debugger shows a 403 or a timeout, your firewall or bot protection may be blocking the crawler. Allow the platform user agents (facebookexternalhit, LinkedInBot, Twitterbot, Slackbot) through.

A workflow for share-ready pages

Plan the copy and image before you build anything. The Neemtools Social Media Preview lays the same title, description and image out as Facebook, X and LinkedIn cards, so you can catch a title that is too long or an image whose text gets cropped. The Open Graph Preview then generates the six core Open Graph tags with safely escaped values and a live card. Add the twitter:card line by hand, since it is not an Open Graph tag.

If you are writing the rest of the head at the same time, the Meta Tag Generator produces the title, description, robots and canonical tags. Once the page is deployed, view the page source to confirm the tags are in the server HTML, then run the URL through the Facebook Sharing Debugger and LinkedIn Post Inspector before the first real share.

More guides you might like

Ready to try it?

Open the free Social Media Preview and apply what you just read. No sign-up, nothing uploaded.

Open Social Media Preview →

← All guides