How to Generate Open Graph Tags
- Enter your page's title and description, and keep an eye on the character counters.
- Add the full page URL and an image URL. Use an image of at least 1200×630 pixels hosted on your site.
- Choose the type (website for home pages, article for blog posts, product for shop pages) and fill in your X usernames.
- Check the live previews and fix any warnings, such as a missing image, a title that's too long or the wrong image ratio.
- Copy the tags and paste them inside the
<head>of your page.
Why Social Preview Tags Are Critical for Click-Through Rates
When someone shares your link on Facebook, LinkedIn, X, WhatsApp, Slack or Discord, the platform reads your page's Open Graph tags to build a preview card. Without them, platforms guess, often picking the wrong image, a cookie notice as the description, or showing a bare URL. A card with a compelling headline and a large, relevant image takes up far more space in the feed and earns noticeably more clicks than a plain link. The same tags power link previews in messaging apps, so good OG tags help every time your content is shared, not just when you post it yourself.
Complete Guide to the Open Graph Protocol
| Tag | What it does | Best practice |
|---|---|---|
og:title | Headline of the card | Under 60 characters so it isn't cut off; don't repeat the site name |
og:description | Summary under the title | 110–160 characters with a clear benefit |
og:image | The preview image | Absolute https URL, 1200×630 px (1.91:1), under 5 MB, key content centred |
og:url | Canonical address of the page | Full URL without tracking parameters |
og:type | Kind of content | website, article, product, profile, video |
og:site_name | Your brand name | Shown above or below the title on some platforms |
twitter:card | X card layout | summary_large_image for articles and landing pages |
X reads the Open Graph tags as a fallback, but twitter:card is required to choose the large-image layout, and twitter:site links the card to your account.
Image Size Guide
Use a single 1200×630 px image for Facebook, LinkedIn, X large cards, Slack and Discord. Keep text and faces away from the edges, since some platforms crop to a square or a 2:1 ratio. For the small X "summary" card, the image is shown as a square thumbnail. Need to resize an image? Use our OG Image Resizer.
Real-World Example
A gardening blog shared its post "10 Easy Houseplants That Are Almost Impossible to Kill" without OG tags, and Facebook showed the site logo and the first line of the cookie banner. After adding the tags generated here, with a bright 1200×630 photo, a 140-character description and og:type set to article, every new share showed a large image card. Remember that platforms cache previews: after changing tags, use Facebook's Sharing Debugger or LinkedIn's Post Inspector to refresh the cached version.
Open Graph Tags for Different Page Types
Choose og:type to match the page. Use website for your home page and category pages, article for blog posts and news, which unlocks article:published_time, article:author and article:section, product for shop pages, and profile for author or team pages. Each page should have its own title, description and, ideally, its own image; reusing one generic image across the whole site makes every share look the same and lowers engagement. For product pages, show the product on a clean background; for articles, use a strong photo or a branded graphic with a short headline in large text, since many people see the card on a small phone screen.
After publishing, test the live URL in the platforms' own tools: Facebook's Sharing Debugger, LinkedIn's Post Inspector and the card preview when you compose a post on X. They show exactly what each crawler sees and let you clear old cached previews.
Frequently Asked Questions
Where do I put Open Graph tags?
Inside the <head> section of each page's HTML. In WordPress, SEO plugins such as Yoast or Rank Math add them for you.
Why isn't my new image showing on Facebook?
Facebook caches previews. Open the Sharing Debugger, enter your URL and click "Scrape Again".
Do Open Graph tags help SEO?
They're not a direct Google ranking factor, but better social previews bring more clicks and shares, which helps your content get discovered.
What is the best Open Graph image size?
1200×630 pixels, a 1.91:1 ratio, in JPG or PNG format, under 5 MB.
Can I use a relative image URL?
No. og:image must be an absolute URL, including https://, or platforms won't find the image.