What Is Open Graph? OG Meta Tags, Image Sizes and Twitter Cards (2026)
Open Graph is the set of og: meta tags that controls link previews. The four required tags, image sizes, Twitter cards, and how to test what platforms see.
Open Graph is a set of meta tags that tells Facebook, LinkedIn, X, Slack, WhatsApp and other apps what to show when someone shares your link: the title, the description, the image and the URL. The tags go in the page's <head> as <meta property="og:..." content="...">. Facebook created the Open Graph protocol, and the apps that build link previews now read it. Without the tags, each app guesses, and the card shows the wrong image, a cut-off title or a bare URL.
You shared a link and the preview came out wrong, or someone on your team asked what "OG tags" are. The sections below cover the four tags every page needs, the optional ones worth adding, an image size that works on every platform, how Twitter cards relate to Open Graph, and how to test what each platform receives.
Key takeaways
- Open Graph is the protocol behind link previews. Platforms read
og:meta tags from your HTML to build the card. - Four tags are required:
og:title,og:type,og:imageandog:url. Addog:descriptionas well, since LinkedIn lists it as required. - A 1200 by 630 pixel PNG or JPEG at an absolute
https://URL works on Facebook, LinkedIn and X. - X reads Open Graph tags when its own
twitter:tags are missing. It still needstwitter:cardto pick the card type. - Social crawlers read the HTML your server sends and don't run JavaScript, so tags that a JavaScript app adds in the browser often never reach them.
- Platforms store each card. After a change, refresh it with the Sharing Debugger on Facebook and the Post Inspector on LinkedIn.
What is Open Graph and how does it work?
The Open Graph protocol lets "any web page become a rich object in a social graph", in the words of the official specification. Facebook created it so a shared page could show a title, an image and a description in the feed. LinkedIn, X, Threads, Slack, WhatsApp and Discord read the same tags today.
When someone pastes your URL, the platform's crawler requests the page, reads the og: tags in the <head>, downloads the image named in og:image and builds the card. Facebook's crawler identifies itself as facebookexternalhit, LinkedIn's as LinkedInBot and X's as Twitterbot. The platform stores the card, and later shares of the same URL reuse it until you ask for a fresh scrape.
Every tag follows one pattern:
<meta property="og:title" content="What Is Open Graph?" />
property names the field and content holds the value. Open Graph tags use the property attribute. Twitter card tags use name, which is one of the few places the two sets differ.
What happens if a page has no Open Graph tags?
The platform guesses. Most fall back to the page's <title> element and meta description, then either pick an image from the page or show none. Some show the bare URL. Each platform guesses differently, so one link can look different in Slack, on LinkedIn and in WhatsApp. With the tags in place, every platform builds the card from the same values.
The four required Open Graph tags
| Tag | What it holds | Example |
|---|---|---|
og:title | The title as it should appear in the card | What Is Open Graph? |
og:type | The kind of page: website, article, profile and others | article |
og:image | The absolute URL of the preview image | https://example.com/og/open-graph.png |
og:url | The canonical URL of the page, used as its permanent ID | https://example.com/blog/open-graph |
With a description added, they look like this in the <head>:
<head><title>What Is Open Graph? | Example</title><meta property="og:title" content="What Is Open Graph?" /><meta property="og:type" content="article" /><meta property="og:image" content="https://example.com/og/open-graph.png" /><meta property="og:url" content="https://example.com/blog/open-graph" /><meta property="og:description" content="The tags that control your link preview, and how to test them." /></head>
Three rules catch most mistakes:
og:imageandog:urlneed absolute URLs that start withhttps://. A path such as/og.pngworks in your browser and fails in every scraper.og:urlshould match the page's canonical URL, so every share of the page, with or without tracking parameters, points to the same object.- Each page needs its own values. Tags copied into every page give every link the same card.
To see which of these tags a page has, paste its URL into the OG Image Checker. It lists each tag it found and builds the Facebook, LinkedIn and X cards from the raw HTML, the same HTML a social crawler reads.
Optional Open Graph meta tags worth adding
| Tag | What it does |
|---|---|
og:description | One or two sentences shown under the title. LinkedIn lists it as a required tag. |
og:site_name | The name of the site the page belongs to, such as your brand. |
og:locale | The language and region of the tags, such as en_US, which is the default. |
og:image:width and og:image:height | The image size in pixels. Facebook uses them to show the image on the first share, before it has downloaded the file. |
og:image:alt | A description of what the image shows, for people who use screen readers. |
og:image:type | The image's MIME type, such as image/png. |
og:video and og:audio | A video or audio file that goes with the page. |
Open Graph types
og:type tells the platform what kind of thing the page is. Any page without it is treated as website.
| Type | Use it for |
|---|---|
website | The home page, landing pages and most other pages |
article | Blog posts and news. It adds article:published_time, article:author, article:section and article:tag. |
profile | A page about one person, with profile:first_name, profile:last_name and profile:username |
book | A book, with book:author and book:isbn |
video.movie, video.episode, video.tv_show, video.other | Pages built around a video |
music.song, music.album, music.playlist, music.radio_station | Pages built around music |
Most sites need two of them: website for the home page and landing pages, and article for posts.
Open Graph image size and format
Make one image at 1200 by 630 pixels, save it as PNG or JPEG, and keep it well under 5 MB. Each platform crops a little differently, so keep text and logos away from the edges.
| Platform | Minimum | Recommended | Ratio | Largest file |
|---|---|---|---|---|
| 600 × 315 for the large card, 200 × 200 for any card | 1200 × 630 | 1.91:1 | 8 MB | |
| 1200 × 627 | 1200 × 627 | 1.91:1 | 5 MB | |
X, summary_large_image | 300 × 157 | Up to 4096 × 4096 | 2:1 | 5 MB |
The Facebook figures come from Meta's image guidelines and the LinkedIn figures from LinkedIn's sharing help page. X has removed its card documentation from its developer site, so its figures are the ones that documentation listed.
A 1200 by 630 image matches the 1.91:1 ratio, and X trims about 30 pixels of height to fit 2:1. Two more rules from Meta apply everywhere: Facebook stores images by URL, so a new image needs a new file name, and its crawler has to fetch an image once before it can show it, which is why og:image:width and og:image:height help on the first share.
Open Graph vs Twitter cards
X (formerly Twitter) has its own set of tags, called Twitter cards. For links shared on X they do the job Open Graph does elsewhere, and X falls back to Open Graph when they're missing.
| Twitter card tag | Falls back to | What it does |
|---|---|---|
twitter:card | Nothing | The card type: summary, summary_large_image, app or player |
twitter:title | og:title | The title on X |
twitter:description | og:description | The description on X |
twitter:image | og:image | The image on X |
twitter:site | Nothing | The X account of the site, such as @yourbrand |
twitter:creator | Nothing | The X account of the author |
The four card types:
summary: a small square image next to the title and description.summary_large_image: a large image above the title. This is the card most sites want.app: a card that links to an app in the App Store or Google Play.player: a card that plays video or audio inside the post.
With the Open Graph tags in place, X needs one more tag: twitter:card, because it has no Open Graph equivalent. Add twitter:site if you want the card tied to your account, and add the other twitter: tags only when X should show different values from everyone else.
<meta name="twitter:card" content="summary_large_image" /><meta name="twitter:site" content="@yourbrand" />
Open Graph, Twitter cards and schema.org side by side
Pages often carry the same title, description and image three or four times, for different readers. This table maps them:
| Field | HTML | Open Graph | Twitter card | Schema.org JSON-LD |
|---|---|---|---|---|
| Title | <title> | og:title | twitter:title | headline or name |
| Description | <meta name="description"> | og:description | twitter:description | description |
| Image | None | og:image | twitter:image | image |
| URL | <link rel="canonical"> | og:url | None | url |
| Kind of page | None | og:type | twitter:card (card style) | @type |
| Read by | Browsers and search engines | Social and chat apps | X | Google and other search engines |
The values can differ. A card title can be shorter than the <title> element, for example. The URLs should always agree.
Why Open Graph tags don't show up
Work through these in order. The first one accounts for most broken previews on modern JavaScript sites.
- JavaScript adds the tags. Social crawlers read the HTML your server sends and leave without running your scripts. Sites built with React, Vue or an AI website builder such as Lovable often send an almost empty HTML file, and the tags appear only after the page loads in a browser. Open the page with View Page Source, which shows what the server sent, and search for
og:. The browser's element inspector shows the page after JavaScript ran, so it can show tags the crawler never got. The fix is to render the tags on the server for each route, or to pre-render each page so crawlers get finished HTML. For a Lovable site, the Lovable link preview guide covers both stacks. - The image URL fails. A relative path, an image behind a login or on a protected path, or a file over the platform's size limit all show up as a missing image. Open the exact
og:imageURL in a private browser window. - The page has the tags twice. A theme and an SEO plugin can each add an
og:title. Several scrapers take the first tag they find and ignore the rest, so the value you edited may not be the one they read. - The platform stored an old card. Your fix is live, and the platform still shows the card it built before. The next section covers how to refresh it.
To see the exact HTML one platform gets, request the page as its crawler with the Facebook crawler simulator. It sends the facebookexternalhit user agent and shows the status code, the raw HTML and the Open Graph tags that came back.
How to test Open Graph tags and refresh a cached preview
| Where | Tool | What to do |
|---|---|---|
| Any platform | OG Image Checker | Paste the URL to see the tags found and the Facebook, LinkedIn and X cards |
| Sharing Debugger | Paste the URL and press Scrape Again. It fetches the page and stores the new card. | |
| Post Inspector | Paste the URL. Each inspection fetches the page again. | |
| Slack, WhatsApp, Discord | None | Share the URL with a query parameter such as ?v=2 to get a fresh card while you test |
The query parameter only helps you test. Real shares use the plain URL, so refresh the platforms that offer a tool, then drop the parameter.
Open Graph tags in Next.js, Nuxt and single-page apps
Frameworks that render on the server write the tags into the HTML that crawlers get. In the Next.js App Router, return them from generateMetadata for each route:
// app/blog/[slug]/page.tsxexport async function generateMetadata({ params }) {const { slug } = await params;const post = await getPost(slug);return {title: post.title,openGraph: {title: post.title,description: post.excerpt,url: `https://example.com/blog/${slug}`,type: "article",images: [{ url: post.ogImage, width: 1200, height: 630 }],},twitter: { card: "summary_large_image" },};}
Next.js can also draw a different image for each page with ImageResponse from next/og, so you don't have to design one image per post.
In Nuxt, useSeoMeta sets the same fields:
useSeoMeta({ogTitle: post.title,ogDescription: post.excerpt,ogImage: post.ogImage,twitterCard: "summary_large_image",});
A single-page app built with plain React or Vue is different. Libraries such as React Helmet change the tags in the browser, after the crawler has already left, so each route needs server rendering or pre-rendering before its tags reach the platforms.
Frequently asked questions
What is an Open Graph used for?
Open Graph controls how a link looks when someone shares it. Its tags set the title, description, image and URL that Facebook, LinkedIn, X, Slack, WhatsApp and Discord show in the preview card.
Do Open Graph tags affect SEO?
Open Graph tags aren't a Google ranking factor. They change how your links look on social platforms and in chat apps, and a clear card with the right image gets more clicks when someone shares the page.
Do I need Twitter card tags if I already have Open Graph tags?
Add twitter:card, because it chooses the card type and has no Open Graph equivalent. X reads the title, description and image from your og: tags when the matching twitter: tags are missing.
Can Open Graph tags go in the body?
Put them in the <head>. The specification places them there, and that is where scrapers look for them.
What is an example of Open Graph tags?
The block under the four required Open Graph tags is a complete example for a blog post: title, type, image, URL and description.
