What Open Graph tags are
Open Graph is a set of meta tags, originally created by Facebook, that describe a page for sharing. Social networks, messaging apps and collaboration tools read them to build link previews. Without them, each app guesses, often picking a logo, a random image or the cookie banner text.
The essential tags
<meta property="og:title" content="How to Set Open Graph Tags"> <meta property="og:description" content="Make shared links show the right title, text and image."> <meta property="og:image" content="https://example.com/images/og-guide.jpg"> <meta property="og:url" content="https://example.com/guides/open-graph/"> <meta property="og:type" content="article"> <meta property="og:site_name" content="Example"> <meta name="twitter:card" content="summary_large_image">
- og:title: can differ from your SEO title; write it for a social feed.
- og:description: one or two sentences; some apps show it, some do not.
- og:image: a full, public https URL.
- og:url: the canonical URL, so shares of different versions count as one page.
- og:type:
websitefor most pages,articlefor posts. - twitter:card: X reads og: tags as a fallback, but this tag chooses the large or small card style.
All of these go inside the page's <head>.
Getting the image right
- Size: 1200 x 630 px (about 1.91:1) works well for large cards on most platforms.
- Safe area: keep text and faces away from the edges, since some apps crop to a square or a different ratio.
- Text: keep any words on the image short and large; cards are often seen small on phones.
- File: JPG or PNG, reasonably compressed. Our image resizer can produce an exact 1200 px wide version.
Setting tags in WordPress and other platforms
In WordPress, SEO plugins such as Yoast and Rank Math include social fields for each post, where you set the title, description and image; they output the tags for you. Shopify, Squarespace, Wix and similar platforms have a social sharing image setting at site and page level. On a hand-built site, paste the tags from the Open Graph generator into each page's head.
Testing and refreshing previews
- Check the tags in the generator's previews first.
- Publish, then view the page source to confirm the tags are really in the head, not added later by JavaScript, which some crawlers do not run.
- Share the link in a private message to yourself to see the real card.
- If an old preview sticks, use the platform's developer tool to re-fetch the page. Facebook's Sharing Debugger and LinkedIn's Post Inspector both do this.
Open Graph and SEO
Open Graph tags do not change search rankings directly. They affect how many people click your link when it is shared, which brings visits, and sometimes links. Treat them like the meta description: a small, durable piece of copy worth writing on purpose. Our guide on meta description length covers the search version.