Esc

    ↑ ↓ to moveEnter to openEsc to close

    Guide

    The Social Card Checklist

    Every tag a page needs to look right when it's shared, and the image size each platform wants.

    Most people meet a page as a link in a feed or a chat, so the card it turns into is the first impression. This is the list I'd go through for any page that's going to be shared.

    The Required Tags

    Open Graph is the set of og: meta tags Facebook introduced in 2010, and nearly every app that shows link previews reads them now. The protocol itself says 4 tags are required, and I'd treat the description as required too, since every platform shows it when it's there:

    HTML
    <meta property="og:title" content="Open Graph Tags: The Complete Checklist">
    <meta property="og:description" content="Every tag a page needs to look right when it's shared.">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://example.com/open-graph-checklist/">
    <meta property="og:image" content="https://example.com/social/open-graph-checklist.jpg">
    

    A few notes on each one:

    • og:title can be the same as your <title>, or a shorter version without the site name. It shows in bold on most cards.
    • og:description is one or two sentences. Most cards cut it after a line or two, so put the useful part first.
    • og:type is website for most pages. There's an article type, which unlocks extra tags like article:published_time, but the big platforms don't change the card for it.
    • og:url is the canonical address of the page. Facebook treats it as the real URL and fetches the tags from there, so it has to point to the page itself, on the live domain.
    • og:image is the full address of the image, starting with https://. A relative path like /social/card.jpg breaks on most platforms.

    These go in the <head>, in the HTML the server sends. Crawlers that build link previews generally don't run JavaScript, so tags added by a client-side script are invisible to them. If your site is a single-page app, the tags need to be rendered on the server or at build time.

    AI crawlers and agents have the same blind spot, which my agent-ready checklist goes into.

    The Image Tags

    Adding 3 more lines makes the image behave better:

    HTML
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:image:alt" content="A short description of what the image shows">
    

    The width and height matter more than they look. Facebook's documentation says its crawler has to download and process an image before it can show it, so the very first share of a new page can go out without one. Declaring the size lets it render the image right away.

    The alt text is read by screen readers on the platforms that support it, and it costs one line.

    The X Card Tags

    X reads the og: tags too, so you only need one tag of its own:

    HTML
    <meta name="twitter:card" content="summary_large_image">
    

    Without it, X falls back to the small summary card, with a square thumbnail next to the text. With summary_large_image you get the full-width image.

    The rest are optional. The other twitter: tags only matter if you want X to show something different from the Open Graph version, and twitter:site names the X account behind the site. Note that these use name= where the Open Graph tags use property=.

    Image Sizes per Platform

    If you only make one image, make it 1200 by 630 pixels, as a JPEG or PNG under 1 MB. That's close enough to every platform's preferred ratio to get the large card everywhere.

    Here's what each platform publishes:

    PlatformRecommendedMinimumRatioMax file size
    Facebook1200 x 630600 x 315 for the large card, 200 x 200 at all1.91:18 MB
    LinkedInat least 1200 x 627under 401 wide shows as a thumbnail1.91:15 MB
    X (summary_large_image)none stated300 x 157, up to 4096 x 40962:15 MB
    Slack, Discord, iMessagenone publishednone publisheduses og:imagenone published

    Sources: Facebook's Sharing for Webmasters docs, LinkedIn Help, and X's developer docs for Cards.

    X's 2:1 is a little wider than 1.91:1, so a 1200 by 630 image gets trimmed slightly at the top and bottom there. Keep text and faces away from the edges and it won't matter.

    For file types, JPEG and PNG work everywhere. X also takes WebP and GIF (only the first frame of an animated one), and SVG isn't supported by X or Facebook. Support for WebP and AVIF elsewhere is patchy, so I'd stick with JPEG for photos and PNG for flat graphics.

    A Real Example

    This is what this site sends for one of its guides, from the page's head (the template is partials/header.php), leaving out the twitter: lines that repeat the Open Graph values:

    HTML
    <meta property="og:title" content="Why Your Cron Job Isn't Running · Jon C. Phillips">
    <meta property="og:description" content="A cron job that works by hand but never runs from cron usually fails without a word. Here are 12 causes to check, from PATH to a missing newline.">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://joncphillips.com/why-your-cron-job-isnt-running/">
    <meta property="og:image" content="https://joncphillips.com/uploads/social/why-your-cron-job-isnt-running-social-1200x630.jpg">
    <meta property="og:image:width" content="1200">
    <meta property="og:image:height" content="630">
    <meta property="og:image:alt" content="Why Your Cron Job Isn't Running, a guide by Jon C. Phillips">
    <meta property="og:site_name" content="Jon C. Phillips">
    <meta property="og:locale" content="en_US">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:site" content="@joncphillips">
    <meta name="twitter:creator" content="@joncphillips">
    

    This guide's image is a 1200 by 630 JPEG of about 85 KB, and each article has its own. Every other page shares one image for the whole site.

    Common Mistakes

    These are the ones that come up over and over:

    • A relative image URL. /images/card.jpg works in a browser and fails in a crawler, so always use the full address.
    • The same tags on every page. A site-wide title and description in the layout means every shared link looks identical. Generate them per page.
    • An og:url that points somewhere else. Copying the homepage's tags into a template leaves every page claiming to be the homepage, and Facebook will show the homepage's card for all of them.
    • A staging domain in the tags. Tags built from an environment variable can end up pointing at staging.example.com, which the platforms can't reach.
    • An image that's too big. A 6 MB PNG straight out of a design tool goes over the limits on X and LinkedIn.
    • Text in the image that's too small. Cards show up small on phones, so a headline that's readable at 1200 pixels wide can be a smudge in a feed.
    • Tags in the body, or added by JavaScript. Most crawlers never see either.

    Testing With Social Card Preview

    Checking by sharing the link for real is a bad idea, because the platform caches whatever it found the first time. The Social Card Preview is the tool I made for this. Paste a URL and it fetches the page from a server the way a platform's crawler would, reads the og: and twitter: tags, and downloads the image to check its dimensions and file size.

    It then shows roughly how the card will look on the main social sites and chat apps, along with a list of what's missing. The previews won't be pixel perfect, since the platforms change their designs often, but they'll show you a missing image or a cut-off title before anyone else sees it.

    It needs the page to be reachable from the internet, so it won't work on localhost or a staging site behind a password.

    Clearing Caches

    Every platform caches a card the first time someone shares the link, so fixing your tags doesn't fix links that are already out there.

    When you change something, here's how to get each one to look again:

    • Facebook: paste the URL into the Sharing Debugger and click Scrape Again.
    • LinkedIn: the Post Inspector fetches the page fresh when you inspect it.
    • X: the old Card Validator no longer shows previews. Paste the link into a new post and look at the card in the composer without posting, and expect old shares to update on their own after a while.
    • Slack and Discord: there's no tool for it, and their caches clear on their own eventually.

    For all of them, adding a query string like ?v=2 to the link you share makes it a new URL, and you get a fresh card right away.

    If you change the image itself, give the new file a new name. Facebook caches images by their URL, so overwriting card.jpg with a new picture can keep the old one showing.

    The Checklist

    • og:title, og:description, og:type, og:url, and og:image are in the <head> of the server-rendered HTML
    • The title and description are written for each page
    • og:url is the page's own canonical URL on the live domain
    • og:image is a full https:// URL that loads in a private browser window
    • The image is 1200 by 630, a JPEG or PNG, and under 1 MB
    • Nothing important sits near the edges of the image
    • og:image:width, og:image:height, and og:image:alt are set
    • twitter:card is summary_large_image
    • robots.txt doesn't block the page or the image from the platforms' crawlers
    • The page passes the Social Card Preview
    • Facebook's and LinkedIn's caches are refreshed after any change

    Social cards are one of a long list of small launch details that are easy to miss. My launch checklist has the rest.