env.dev

OpenGraph Meta Tags Cheat Sheet — Sizes, Tags, Twitter Cards

Every OpenGraph and Twitter Card tag with recommended image sizes per platform (Facebook, LinkedIn, X, Slack, Discord) and a copyable HTML template.

Last updated:

An OpenGraph tag is a <meta> element in a page's <head> that tells Facebook, LinkedIn, Slack, Discord, X and every other link unfurler how to render a preview card. This cheatsheet covers every tag you'll actually use, the recommended image sizes per platform, and a copyable template you can drop into any page.

Essential OpenGraph Tags

Set these on every page. Missing any of them degrades the preview on at least one major platform.

TagPurposeExample / Notes
og:titleHeadline shown in the preview card.Keep under 60 characters. Facebook truncates at ~70.
og:descriptionSubtitle/body text under the title.Aim for 100–200 characters. LinkedIn shows ~200, X ~125.
og:imageAbsolute URL of the preview image.Must be absolute (https://...), publicly fetchable, and under 5 MB.
og:urlCanonical URL of the page.Set explicitly — unfurlers use this to dedupe previews across tracking params.
og:typeObject type.website, article, profile, video.other. Defaults to website.
og:site_nameName of the parent site.Shown above the card on Facebook and LinkedIn.
og:localeContent locale.Format is language_TERRITORY, e.g. en_US, sv_SE, de_DE.

OpenGraph Image Tags

Declaring dimensions lets Discord, Slack, and some proxies render the preview without fetching the image first.

TagPurposeExample / Notes
og:image:widthImage width in pixels.1200
og:image:heightImage height in pixels.630
og:image:altAlt text for screen readers and fallback.A descriptive sentence. Max ~420 characters.
og:image:typeMIME type of the image.image/png, image/jpeg. Helps strict parsers.
og:image:secure_urlHTTPS URL of the image.Historical; most modern sites can omit and rely on og:image.

Recommended Image Sizes Per Platform

Universal safe default: 1200×630. Use it unless a specific platform is your primary channel.

PlatformSize (px)AspectMax fileNotes
Facebook1200×6301.91:18 MBRejects < 200×200. Warns < 600×315.
LinkedIn1200×6271.91:15 MBCaches 7 days. Use Post Inspector to force re-scrape.
X (summary_large_image)1200×67516:95 MBCrops top/bottom if given 1200×630.
X (summary)144×144 min1:15 MBSmall thumbnail next to the text.
Slack1200×6301.91:15 MBCaches 24h. Requires valid Content-Type on the image.
Discord1280×6402:18 MBAccepts og:image; width/height help preview sizing.
iMessage1200×6301.91:15 MBSquare-crops on iOS lock screen.
WhatsApp1200×6301.91:1300 KB softAggressive size cap — larger images are sometimes skipped.
Telegram1200×6301.91:15 MBRespects og:image:width and og:image:height.

Twitter Card Tags

X reads OpenGraph as a fallback, but twitter:card must be set for a rich preview. Use summary_large_image for most content.

TagPurposeExample / Notes
twitter:cardCard type.summary, summary_large_image, player, app. summary_large_image is the best default.
twitter:siteOwner @handle.@envdev
twitter:creatorAuthor @handle.@ersimsdev
twitter:titleOverride og:title for X.Optional — falls back to og:title.
twitter:descriptionOverride og:description for X.Optional — falls back to og:description.
twitter:imageOverride og:image for X.Optional — falls back to og:image.
twitter:image:altAlt text for the image.Max 420 characters.

Article-Specific Tags

Set og:type="article" and add these to unlock richer rendering on Facebook and LinkedIn.

TagPurposeExample / Notes
article:published_timeISO 8601 publish date.2026-04-22T10:00:00Z
article:modified_timeISO 8601 last update.Update on every edit — improves freshness signals.
article:authorAuthor URL or name.https://example.com/authors/alice
article:sectionTop-level category.Engineering, Product, Tutorials
article:tagTag/keyword (repeatable).One tag per meta element. Repeat for multiple.

Validation Tools

Paste your URL into these to see exactly how each platform renders it.

PlatformTool / Method
Facebookdevelopers.facebook.com/tools/debug/
LinkedInlinkedin.com/post-inspector/
XCard Validator retired in 2023. Post the URL to a test account to preview.
SlackNo validator. Paste the URL in a DM to yourself.
DiscordNo validator. Paste into a private channel.
WhatsApp / iMessage / TelegramNo validator. Send the link to yourself.

Quick Copyable Template

Drop this into the <head> of any page and replace the values.

html
<!-- OpenGraph -->
<meta property="og:title" content="Your page title">
<meta property="og:description" content="A 100–200 character summary.">
<meta property="og:url" content="https://example.com/page">
<meta property="og:image" content="https://example.com/og.png">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="Descriptive alt text.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="Example">
<meta property="og:locale" content="en_US">

<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@example">
<meta name="twitter:title" content="Your page title">
<meta name="twitter:description" content="A 100–200 character summary.">
<meta name="twitter:image" content="https://example.com/og.png">

Common Mistakes

Relative image URLs

og:image must be an absolute URL (https://...). Relative paths break on every unfurler because the crawler fetches the page, not your site.

Missing og:url

Without og:url, previews can vary based on redirects and tracking params. Always pin the canonical URL explicitly.

Wrong image size

Facebook rejects images smaller than 200×200. Discord and Slack favour 1.91:1 or 2:1. Use 1200×630 unless you have a specific reason not to.

Image behind auth

If the image URL requires a session cookie or is behind hotlink protection, the unfurler sees a 403 and shows no image. Test with curl from a clean IP.

WebP for og:image

Some Slack and Discord clients reject WebP. Stick to PNG or JPEG for maximum compatibility.

Generate a full tag set with your values using the Meta Tag Generator or read the Open Graph Protocol guide for the full story.

Frequently Asked Questions

What size should an OpenGraph image be?

1200×630 pixels (1.91:1 aspect ratio) is the safe default across Facebook, LinkedIn, Slack, and iMessage. X prefers 1200×675 (16:9) for summary_large_image. Keep files under 5 MB and use PNG or JPEG.

What is the difference between og:image and twitter:image?

og:image is the OpenGraph image used by most unfurlers (Facebook, LinkedIn, Slack, Discord, iMessage). twitter:image is only read by X when you also set twitter:card. If twitter:image is absent, X falls back to og:image.

Is og:url required?

Not strictly, but without it unfurlers guess the canonical URL from the fetched page. Set og:url explicitly to the canonical URL to avoid duplicate-preview issues when the same page is reachable via multiple URLs.