Open Graph Tags and Social Share Images: A Practical Guide
Paste a link into Facebook, LinkedIn, X, Slack or a text message and, a moment later, a little card appears: a picture, a headline and a line of text. That card is often the first thing a potential customer sees of your business, and it comes from a handful of tags in your page's HTML called Open Graph tags.
When those tags are missing, the card falls back to whatever the platform can scrape: a random logo, a cropped photo, a headline from your cookie banner, or nothing at all. This guide explains, using the Open Graph protocol itself and the documentation from Meta, X and Google, which tags every page needs, what size to make share images, and how to fix previews that are wrong or out of date.
Key facts
- 4 — Required Open Graph properties: og:title, og:type, og:image and og:url
- 1200 × 630 — Minimum pixel size Meta recommends for share images on high-resolution screens
- 1.91:1 — Aspect ratio Meta suggests so the image is not cropped in Feed
- 5 MB — Maximum image file size for X cards (Meta allows up to 8 MB)
What Open Graph Tags Are
The Open Graph protocol was created at Facebook so that any web page could become a "rich object" when it is shared. It is now read by most social networks, messaging apps and chat tools. The tags are ordinary <meta> elements in the <head> of the page, each with a property attribute that starts with og:.
The protocol lists four properties that every page should have:
- og:title: the title of the page as it should appear in the card.
- og:type: the kind of object, for example
websitefor a home page orarticlefor a blog post. - og:image: the URL of an image that represents the page.
- og:url: the canonical URL of the page, used as its permanent ID.
A minimal, correct set for a service page looks like this:
<meta property="og:title" content="Emergency Plumbing in Springfield">
<meta property="og:type" content="website">
<meta property="og:url" content="https://example.com/emergency-plumbing/">
<meta property="og:image" content="https://example.com/img/share/emergency-plumbing.jpg">
<meta property="og:description" content="24/7 call-outs, upfront pricing and licensed plumbers.">
<meta property="og:site_name" content="Example Plumbing">Use absolute URLs, starting with https://, for og:url and og:image. A relative path such as /img/share.jpg means nothing to a crawler reading your tags from another server.
The Optional Tags Worth Adding
Beyond the required four, a few optional properties make your previews more reliable:
- og:description: the protocol describes it as "a one to two sentence description" of the page. You can often reuse your meta description.
- og:site_name: the name of the overall site, shown by some platforms above or below the title.
- og:locale: the language and region of the tags, in
language_TERRITORYform such asen_US(the default). - og:image:width and og:image:height: the image size in pixels.
- og:image:alt: a description of what is in the image, not a caption.
- og:image:type: the image's MIME type, such as
image/jpeg.
Order matters
The image properties are "structured": og:image:width, og:image:height and og:image:alt belong to the nearest og:image tag above them. If you list more than one image, put each image's details directly under it. The protocol also says that when a tag appears more than once with conflicting values, the first one wins, so a theme and a plugin both printing og:title can leave you with the wrong one.
Width and height are not just decoration
Meta explains that its crawler has to process an image before it can show it, so the very first person to share a new URL may see a card with no image. Adding og:image:width and og:image:height is one of the fixes Meta lists, because it lets the image render straight away.
Sizing Your Share Image
Different platforms crop and display images differently, but the guidance from Meta and Google points to the same practical target: a wide, landscape image at least 1200 pixels across.
- Meta (Facebook): use images at least 1200 × 630 pixels for high-resolution screens. Images must be at least 200 × 200 pixels, and images smaller than 600 × 315 pixels show as a much smaller thumbnail. Keep the ratio as close to 1.91:1 as you can, and keep the file under 8 MB.
- X: card images must be under 5 MB and can be JPG, PNG, WEBP or GIF. Only the first frame of an animated GIF is used, and SVG is not supported.
- Google Discover: Google recommends large images at least 1200 px wide, more than 300,000 pixels in total, in a 16:9 ratio, and says you can point to that image with
og:imageor schema.org markup.
A 1200 × 630 JPG or WEBP under a few hundred kilobytes satisfies all three. Keep the important part, such as a face, product or short headline, in the middle of the image, because some apps crop the edges or show a square version.
What to put in the image
Google specifically advises against using a generic image, such as your site logo, in og:image for Discover, and against text-heavy images. That is good advice for social cards too. A real photo of the work, the team or the product says more than a logo on a coloured background. If you add text, keep it short and large enough to read on a phone.
How X, LinkedIn and Google Use the Same Tags
You do not need a separate set of tags for every platform. X documents its own twitter: tags, but it falls back to Open Graph for most of them: twitter:title falls back to og:title, twitter:description to og:description, twitter:image to og:image and twitter:image:alt to og:image:alt. The one tag worth adding is the card type, because it controls the layout:
<meta name="twitter:card" content="summary_large_image">Without it, X may show the smaller summary card. Note that X uses the name attribute while Open Graph uses property. LinkedIn, Slack, WhatsApp and most messaging apps also read the standard og: tags, so one good set covers them.
Google Search
Open Graph is not a ranking factor, but Google does read it. Its title link documentation lists og:title among the sources it can use to build the headline in search results, and its image documentation lists og:image, alongside schema.org primaryImageOfPage, as a way to influence which image Google picks as a page's preview. Keeping your Open Graph title consistent with your <title> and main heading helps everything line up.
Testing and Fixing Stale Previews
Platforms cache link previews, often for a long time. That is why a page can keep showing an old title or image after you have fixed the tags. A sensible routine:
- Check the HTML. View the page source and confirm the tags are in the
<head>, appear once each, and use absolute URLs. - Open the image URL directly in a private browser window. It must load without a login, a redirect loop or a hotlink-protection block.
- Run the page through Meta's Sharing Debugger. Meta recommends it to pre-fetch a page's metadata, and it shows the tags it found and any warnings. You can ask it to scrape the page again after a change.
- Use the inspection tools other platforms provide, such as LinkedIn's Post Inspector, to refresh their copy.
Changing an image
Meta caches images by URL. Its advice is to give an updated image a new URL rather than overwriting the old file, to leave old images in place, and to pre-cache the new one. Updating the image also does not change posts that were already shared; those keep the preview they were created with unless they are refreshed.
Common mistakes
- The same
og:imageon every page, usually the logo. og:urlpointing to the home page on every page, which makes each share look like a link to the home page.- Images blocked by robots.txt, a firewall rule or a security plugin that blocks unfamiliar crawlers.
- Duplicate tags from a theme and an SEO plugin, where the first (wrong) value wins.
- SVG or very large PNG files that some platforms will not show.
A Simple Setup for a Small Business Site
You do not need a design team to get this right. For most small sites:
- Create one default 1200 × 630 share image that shows your work or your team, not just your logo, and use it for pages that have no better image.
- Give your most-shared pages, such as the home page, main services and blog posts, their own image.
- Generate
og:title,og:descriptionandog:urlfrom the same values as your<title>, meta description and canonical URL, so they never drift apart. - Add
og:image:width,og:image:height,og:image:altandtwitter:card. - Test each new page in the Sharing Debugger before you share it yourself.
On WordPress, most SEO plugins can output these tags for you; check that your theme is not printing a second set. On a custom site, it is a short template change in the shared header.
Sources
- The Open Graph protocol
- Meta for Developers: Images in Link Shares
- X Developer Platform: Cards markup
- Google Search Central: Discover and your website
- Google Search Central: Image SEO best practices
- Google Search Central: Influencing your title links in search results
Related reading
Frequently asked questions
What size should an Open Graph image be?
Use at least 1200 × 630 pixels, close to a 1.91:1 ratio, as a JPG, PNG or WEBP under 5 MB. That meets Meta's recommendation, fits X's file limit and is wide enough for Google Discover's 1200 px guidance.
Why is Facebook or LinkedIn still showing my old image?
Platforms cache previews. Run the URL through Meta's Sharing Debugger or LinkedIn's Post Inspector to scrape it again, and give a changed image a new file URL instead of overwriting the old one.
Do I need separate Twitter tags as well as Open Graph?
Mostly no. X falls back to og:title, og:description, og:image and og:image:alt. Add twitter:card set to summary_large_image so X shows the large image layout.
Want every page to share with the right picture?
Tell me about your business and I'll send a free, no-obligation quote for a site with correct Open Graph tags and share images on every page.
Get a free quote