Open Graph tags and image size: a practical checklist
When someone pastes your link into Slack, X, LinkedIn or Facebook, the preview card comes from a handful of meta tags in your page's <head>. Here is the short list that matters, and what to check when the card looks wrong.
The tags you need
<meta property="og:title" content="Page title"> <meta property="og:description" content="One or two sentences"> <meta property="og:image" content="https://example.com/card.png"> <meta property="og:url" content="https://example.com/page"> <meta property="og:type" content="website"> <meta name="twitter:card" content="summary_large_image">
- og:title, og:description, og:image, og:url are the core set. Without og:image most platforms show a plain text link.
- twitter:card decides the layout on X. Use
summary_large_imagefor a wide image; without it you may get a small square thumbnail. X falls back to og:title, og:description and og:image when the twitter: versions are missing, so you rarely need to duplicate them. - og:image:width / og:image:height are optional, but they help some crawlers render the card on the first share instead of after a retry.
Image size
- 1200×630 px (about 1.91:1) is the safe default. It is the size Facebook and LinkedIn recommend, and it crops acceptably to X's 2:1 large card.
- Keep the file small (well under 5 MB; under 1 MB is better) and use PNG or JPG. Some platforms skip WebP or SVG images.
- Keep text away from the edges. Platforms crop slightly differently, so leave a margin of roughly 60 px.
Five reasons a preview breaks
- Relative image URL.
/img/card.pngoften fails. Use an absolutehttps://URL. - Tags injected by JavaScript. Most crawlers do not run your scripts. Tags must be in the HTML the server returns, which matters for single-page apps.
- The image is blocked. A login wall, a firewall rule, a bot challenge or a robots.txt rule on the image path stops the crawler from fetching it.
- Old cache. Platforms cache a card after the first share. Changing the image URL (for example adding
?v=2) or using the platform's own debugger forces a refresh. - Wrong attribute. Open Graph uses
property="og:…"; Twitter tags usename="twitter:…". Mixing them up is common.
Check a page now. The free Open Graph checker shows how your link looks on Facebook, X, LinkedIn and Slack and lists missing tags.
Need an image for every page without designing each one? OGCard turns a URL like …/og?title=My%20post into a 1200×630 PNG. Free with a small mark; Pro removes it.