The Starter Template
Since you're likely here for the code, here's the full set. Paste it inside the <head> of your page and change the values.
<meta property="og:title" content="Your Page Title" />
<meta property="og:description" content="One or two sentences about this page." />
<meta property="og:image" content="https://example.com/images/social-card.png" />
<meta property="og:url" content="https://example.com/your-page" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="Your Site" />
<meta name="twitter:card" content="summary_large_image" />That covers Facebook, LinkedIn, X, WhatsApp, Slack, Discord and iMessage. The last line is a Twitter Card tag. X reads the Open Graph tags for everything else.
What Open Graph Tags Are
Open Graph is a small standard Facebook published in 2010. It gives a page a way to say "here's my title, my description and my image" in a form any app can read. When you paste a link into a post or a chat, the app fetches the page, reads these tags and builds the preview card from them.
Without them, apps guess. You get the wrong image, a cut-off title, or a bare URL.
The Four Required Tags
The Open Graph spec calls four tags required on every page:
| Tag | What it does |
|---|---|
| og:title | The headline on the card. |
| og:type | What kind of thing the page is: website, article, video and so on. |
| og:image | The picture on the card. |
| og:url | The page's canonical address. |
Optional Tags Worth Adding
| Tag | What it does |
|---|---|
| og:description | One or two sentences under the title. Optional in the spec, but add it. |
| og:site_name | Your site's name, shown above or below the title in some apps. |
| og:locale | The page's language and region, such as en_US. |
og:image:width | Image width in pixels. Lets Facebook show the image on the first share. |
og:image:height | Image height in pixels. |
og:image:alt | Alt text for the image. |
og:video | A video file or player URL for the page. |
og:audio | An audio file URL for the page. |
og:locale:alternate | Other languages the page is available in. |
Article Tags
When og:type is article, you can add these:
| Tag | What it does |
|---|---|
article:published_time | When the article was first published, as an ISO 8601 date. |
article:modified_time | When it was last changed. |
article:author | The author's profile URL. |
article:section | The section, such as Technology. |
article:tag | A topic tag. Repeat the tag for more than one. |
Property vs. Name
Open Graph tags use property=. Twitter Card tags and regular meta tags use name=.
<meta property="og:title" content="Open Graph uses property" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="description" content="Regular meta tags use name" />Most crawlers forgive a mix-up, but Facebook's debugger will warn about it. It's easier to get it right.
Where the Tags Go
- Inside
<head>, near the top. Facebook only reads the first 1 MB of a page. - In the HTML your server sends. Crawlers don't run JavaScript.
- On every page, with that page's own title, image and URL. Don't copy the homepage tags everywhere.
Need tags for a specific kind of page? The Open Graph examples have copy-paste sets for articles, products and videos, or build your own with the generator.
Frequently Asked Questions
Are Open Graph tags required for SEO?
No. Google doesn't use them as a ranking signal. They control how your link looks on social media and in chat apps, which affects how many people click it. Google does read og:site_name as one hint for your site's name.
What is the difference between Open Graph tags and meta tags?
Open Graph tags are a type of meta tag. Regular meta tags such as the description are written for search engines. Open Graph tags are written for apps that build link previews, and they use property= with an og: prefix.
Do I need Open Graph tags on every page?
Yes, on every page people might share. Each page should have its own og:title, og:image and og:url. If every page carries the homepage tags, every shared link looks like the homepage.
Which Open Graph tags are required?
The spec requires four: og:title, og:type, og:image and og:url. In practice you should also add og:description, plus twitter:card so X shows the large image.
How do I check a page's Open Graph tags?
Paste the URL into the checker on this page. It fetches the page, lists every Open Graph and Twitter tag it finds, flags the missing ones and shows the preview for Facebook, X and LinkedIn.