🏷️ SEO β€’ ⏱ 9 min read β€’ πŸ“… December 3, 2026

Open Graph Tags: How to Add, Test and Fix Link Previews

Open Graph tags control how your links look when shared. Learn which tags you need, how to add them, how to test previews and how to fix common problems.

When someone pastes your link into a chat, a social post or a message, the platform turns it into a small card with an image, a title and a short description. That card is built from Open Graph tags. If they are missing or wrong, your link can show up as a bare URL, a cropped image or the wrong headline, and fewer people are likely to click it.

This guide explains what Open Graph tags are, which ones you actually need, how to add them, how to test them and how to fix the problems that cause broken previews. You will also find a copy-ready example and a checklist you can use before publishing a page.

Key Takeaways

  • Open Graph tags are meta tags in a page’s head section that tell social platforms and messaging apps how to display a shared link.
  • The four core tags are og:title, og:type, og:image and og:url. Adding og:description and og:site_name is recommended.
  • Open Graph tags control how links look when shared. They are not a documented Google ranking factor.
  • Platforms cache previews, so after fixing a tag you may need to refresh the cached version with the platform’s own debugging tool.

What Are Open Graph Tags?

Open Graph is a protocol that was introduced by Facebook and is now used by many platforms and apps. It works through meta tags placed in the head section of an HTML page. Each tag gives the platform one piece of information about the page, such as its title, its main image or its address.

When a link is shared, the platform fetches the page, reads those tags and builds the preview card. If the tags are missing, the platform guesses, and it often guesses badly.

Why Open Graph Tags Matter

  • They control the first impression. A clear image and headline make a shared link look trustworthy and worth opening.
  • They keep your branding consistent. You choose the title, description and image instead of letting each platform pick text and images at random.
  • They can improve click-through from shared links. A well-formed card is easier to notice in a busy feed than a plain link.
  • They work across many platforms. Facebook, LinkedIn, messaging apps and many other services read these tags.

They do not replace normal on-page SEO. Search engines rely mainly on your title tag, content and links. Open Graph tags are about how your page looks when it is shared, so treat them as a presentation and click-through tool rather than a ranking tool.

The Open Graph Tags You Need

Tag What it does Status
og:title The headline shown on the card Required
og:type The kind of content, such as website or article Required
og:image The image shown on the card Required
og:url The canonical address of the page Required
og:description A one or two sentence summary Recommended
og:site_name The name of the website Recommended
og:locale The language and region of the content Optional

Open Graph Tag Example

This example shows how the tags look inside the head section of a page. Replace the values with your own page details, and use full URLs for the address and the image.

<meta property="og:title" content="Open Graph Tags: A Practical Guide" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://example.com/open-graph-guide/" />
<meta property="og:image" content="https://example.com/images/og-guide.jpg" />
<meta property="og:description" content="How to add, test and fix Open Graph tags." />
<meta property="og:site_name" content="Example" />

How to Add Open Graph Tags

Option 1: Generate the Code

Enter your page details into the Open Graph Generator and copy the finished tags into the head section of your page. This works for any website, whatever it is built with.

Option 2: Use Your CMS or SEO Plugin

Most WordPress SEO plugins, including Yoast SEO, add Open Graph tags automatically and let you set a custom title, description and image for each page. If your site already uses a plugin like this, check its social settings before adding tags by hand. Adding the same tags twice can create duplicates that confuse the preview.

Option 3: Edit the Template

If you maintain your own theme or template, add the tags to the head section and fill them with dynamic values, such as the current page title and featured image, so every page gets its own set.

How to Choose the Right Open Graph Image

  • Use a landscape image. A size of about 1200 by 630 pixels, which is roughly a 1.91 to 1 ratio, is widely recommended and displays well on most platforms.
  • Keep important content in the center. Some platforms crop the edges, so avoid placing text close to the border.
  • Keep text short and large. The card is small, and long lines become unreadable.
  • Use an absolute URL. Relative paths often fail because the platform cannot resolve them.
  • Compress the file. A smaller file loads faster and is less likely to time out. The Image Compressor can reduce the size without a visible loss of quality.
  • Make a custom image for important pages. You can build one quickly with the OG Image Generator.

How to Test Your Open Graph Tags

  1. Check the tags on your page. Enter the URL into the Open Graph Checker to see which tags are present and which are missing.
  2. Preview the card. Use the Social Media Preview tool to see roughly how the link will look when shared.
  3. Check the other meta tags. The Meta Tag Checker shows your title, description and other head tags in one place. If you also want to review your search snippet, read our guide on meta description length.
  4. Check the X card tags. X uses its own card tags and can fall back to Open Graph when they are missing. The Twitter Card Checker shows what your page provides.
  5. Use the platform debuggers. Facebook’s Sharing Debugger and LinkedIn’s Post Inspector fetch your page again and show what the platform sees. They also let you clear an old cached preview.

Common Open Graph Problems and Fixes

Problem Likely cause Fix
No image on the preview Missing og:image, or a relative or blocked image URL Add an absolute image URL and make sure the file is publicly accessible
Old title or image still showing The platform cached the earlier version Re-scrape the URL in the platform’s debugging tool
Image cropped badly Wrong size or ratio Use a landscape image of about 1200 by 630 pixels
Wrong title or description Tags missing, so the platform guessed, or duplicate tags Set one clear set of tags and remove duplicates from plugins or the theme
Preview shows the wrong page og:url points to a different address Make og:url match the canonical address of the page
Nothing is picked up at all The tags are not in the head section, or the page is blocked from crawlers Move the tags into the head and check that the page is publicly reachable

Open Graph Best Practices

  • Write a unique title and description for each important page instead of using one site-wide default.
  • Keep the og:title short enough to display without being cut off, and make it clear and specific.
  • Keep og:url consistent with the canonical URL of the page.
  • Use a branded but readable image, and avoid showing text so small that it cannot be read.
  • Provide a fallback default image for pages that do not have their own.
  • Retest after a redesign, a theme change or a plugin update. If URLs change, make sure old addresses lead to the new one in a single step, as explained in our guide to redirect chains.

Open Graph Tags Checklist

  • og:title, og:type, og:image and og:url are present
  • og:description and og:site_name are set
  • Image is landscape, compressed and loads from an absolute URL
  • og:url matches the canonical URL
  • No duplicate tags from plugins and themes
  • Preview checked in a debugging tool after every change

Frequently Asked Questions

What are Open Graph tags?

They are meta tags in the head of a web page that tell social networks and messaging apps which title, description and image to show when the page is shared.

Do Open Graph tags help SEO?

Not directly. They are not a documented ranking factor for Google. They improve how your links look when shared, which can support clicks and visibility on social platforms.

What is the best size for an Open Graph image?

A landscape image of about 1200 by 630 pixels is widely recommended. Keep important content near the center, because platforms may crop the edges.

Why is my old image still showing after I changed it?

Platforms store a cached copy of the preview. Use the platform’s debugging tool to fetch the page again and refresh it.

Do I need Twitter or X card tags as well?

X can use Open Graph tags as a fallback, but adding its own card tag gives you more control over how the card is displayed.

Final Thoughts

Open Graph tags are a small piece of markup with a visible effect. Set the core tags on every important page, choose a clear landscape image, make sure the address matches your canonical URL, and always check the result in a preview tool before you share the link.

Ready to try it? Build your tags with the Open Graph Generator, then confirm them with the Open Graph Checker.

Related Guides

πŸ”— Found this guide helpful? Share it with peers:
← Back to All Articles

Related Articles & Guides

Latest guides published by our research team to help you scale your rankings.