og:image Example
Put it inside the <head> of the page:
<meta property="og:image" content="https://example.com/images/social-card.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="A short description of the image" />Where og:image Shows Up
- Facebook and LinkedIn show it full width above the title.
- X uses it for the card image when
twitter:imageis missing. - Slack, Discord, WhatsApp, Telegram and iMessage all show it, sometimes cropped to a square.
Rules for og:image
- Size: 1200x630 pixels, a 1.91:1 ratio. The OG image size guide has every platform's limits.
- Minimum: 200x200 for Facebook to use it at all, 600x315 for the large card.
- Format: JPG or PNG. SVG doesn't work anywhere.
- File size: under 1 MB is a good target. X and LinkedIn stop at 5 MB, Facebook at 8 MB.
- URL: absolute and
https://. No relative paths.
The Other og:image Tags
| Tag | What it does |
|---|---|
og:image:width | Width in pixels. With the height, lets Facebook show the image on the first share. |
og:image:height | Height in pixels. |
og:image:alt | Alt text for screen readers. |
og:image:type | The MIME type, such as image/png. |
og:image:secure_url | An https:// version of the image. Not needed if og:image is already https. |
You can list more than one og:image. Apps use the first one that meets their requirements, so put your best image first.
Common og:image Mistakes
- A relative path like
/og.png. - An image the crawler can't reach: blocked by robots.txt, a login, hotlink protection or a firewall.
- Reusing the old file name after changing the image. Apps cache images by URL, so rename the file.
- A logo on a transparent background. It lands on white or black depending on the app.
- Adding the tag with JavaScript. Crawlers only read the HTML your server sends.
See the full Open Graph tags list for the tags that go with it.
Frequently Asked Questions
What size should og:image be?
1200x630 pixels, a 1.91:1 aspect ratio. That's Facebook's recommendation, it matches LinkedIn's within three pixels, and X only trims a little from the top and bottom.
Why is my og:image not showing?
The usual causes are a relative URL, an image under 200x200 pixels, a crawler blocked by robots.txt or a firewall, tags added by JavaScript, or the app showing a cached copy from before you added the image.
Can og:image be a WEBP or SVG?
SVG doesn't work on any major platform. WEBP works on most of them, including X and Facebook, but JPG and PNG are the only formats that work everywhere.
Does og:image need to be an absolute URL?
Yes. Use the full address including https://. Some crawlers resolve relative paths and some don't, so a relative URL gives you a preview that works in one app and breaks in another.