← All guides

Platform Guide

Slack Link Unfurl Wrong or Missing: How Slackbot Reads Your Page and Caches It

How Slack unfurls a link, which tags and user agent it uses, how long it caches the result, why a preview can be missing for one person, and how to fix it, based on Slack's own documentation.

What Slackbot sends and which tags it reads

Slack lists its robots at api.slack.com/robots. The first is the link preview fetcher:

  • Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots) responds to links users post in channels. Slack says it requests only part of each page, using HTTP Range headers, to read the metadata. It looks for oEmbed, Twitter Card and Open Graph tags. When those point at an image, video or audio file, it fetches that file too, to check it is valid and to extract its metadata.
  • Slack-ImgProxy 0.19 (+https://api.slack.com/robots) fetches and caches the images posted into channels. Slack says this hides referrer details from the image host and serves the image over HTTPS. The page gives no cache duration for it.
  • Slackbot 1.0 (+https://api.slack.com/robots) is the default robot for any HTTP request the other two do not cover, such as calls to integrated services and Outgoing Webhooks. It is not the link preview fetcher.

Three consequences follow from that page.

Your server sees more than one agent. Look for Slack-ImgProxy in your access logs as well as Slackbot-LinkExpanding. If a firewall or bot rule allows one and blocks the other, you can end up with a preview that has no picture.

Only part of the page is requested. Because the fetch uses Range, your tags need to sit near the top of the document, in the <head>. A server that mishandles Range requests, or a page that puts its tags after a large inline script, is a risk. Slack does not say how many bytes it asks for, so keep the tags first.

robots.txt does not stop it. Slack's page says it does not currently honor robots.txt, because testing that "led to too many user complaints", and describes the bot as acting on behalf of a human rather than crawling. A Disallow rule neither hides a page from Slack nor explains a missing preview. The page says site owners who want to block Slack embeds can contact Slack.

Which tag wins

Slack's documentation lists the three sources (oEmbed, Twitter Card, Open Graph) and does not say which takes precedence when they disagree, or how og:title and twitter:title are reconciled. Anything that claims an exact order for Slack is not coming from Slack's published pages. The reliable approach is to make the sources agree: set the Open Graph tags, and if you also set Twitter Card tags, give them the same title, description and image. Then there is nothing to decide.

A good head for Slack looks like the one below. Slack does not document the size tags as required, but they cost nothing:

<meta property="og:url" content="https://your-site.com/your-page" />
<meta property="og:title" content="Your page title" />
<meta property="og:description" content="One or two sentences." />
<meta property="og:image" content="https://your-site.com/og/your-page-v2.png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name="twitter:card" content="summary_large_image" />

Slack shows the old preview, or none, after you changed the page

Symptom

You fixed the tags or replaced the card. Pasting the link into Slack still gives the old title, the old picture, or nothing.

Cause

Slack caches what it fetched. The robots page says responses to Slackbot-LinkExpanding requests "are cached globally across the service for around 30 minutes". Two details in that sentence matter. It is global, not per workspace: another team posting your link a few minutes ago can leave you with their answer. And it is "around" 30 minutes, so do not plan on a precise cutoff.

A second rule sits on the message side. Slack's help article on sharing links says "no attachment will expand if that link was shared in the same conversation within the past hour." If you post the same URL into the same channel twice while testing, the second post may carry no preview at all, and that is documented behaviour, not a sign your tags are broken. Test in a different conversation, or wait out the hour.

The image has its own path. The image proxy fetches and caches images, and Slack gives no duration for it. If you overwrote /og.png in place, the page's tags did not change and neither did the image URL, so you cannot rely on the proxy noticing.

Fix

  1. Deploy first. The next unfurl reads whatever your server serves at that moment.
  2. Give the changed card a new URL (/og/pricing-v2.png, or a content hash or version in a query string) and point og:image at it. A new URL cannot collide with a copy held under the old one. Slack does not publish how its image cache is keyed, so confirm on your own link that the new picture appears.
  3. Wait out the cache. After roughly 30 minutes, post the link again in a conversation where it has not been posted in the last hour.

There is no documented refresh button

No Slack page I read describes a way to force Slack to fetch your page again, nothing like Facebook's re-scrape. The Unfurl Debugger, covered below, lets an administrator inspect a link's metadata, but Slack's pages do not say it clears the cache that real messages use. Adding a query string to the page URL (?v=2) gives Slack a different link to fetch. Slack does not document how its cache is keyed, so use that for testing, and do not publish the altered URL as your fix.

Detected by

properOG cannot see Slack's cache. What it does catch is the half you control: image_uncacheable in the site audit flags a card whose response forbids caching, which hurts here because Slack's image proxy fetches the card from your origin.

Slack shows no image, or the wrong one

Symptom

The unfurl has a title and a description and no picture, or it shows a logo, a tiny square or another page's image.

Cause and fix

Work down the list. The first two cover most cases.

The page declares no image. With no image tag, Slack has nothing to attach. Slack's documentation says it reads Open Graph and Twitter Card tags, so a page with only a <title> and a meta description unfurls as text. The audit reports this as image_missing (critical), with the pages that lack it. On a Next.js site the cause is often a replaced openGraph object, which the Next.js guide traces trap by trap.

The image does not load for Slack. Slackbot fetches the image file to check it is valid. A 404, a redirect to a login page, a hotlink rule that only allows your own domain, or a firewall that blocks automated agents all end with no picture. Run the image URL through the commands in the step-by-step section, and look in your logs for both Slackbot-LinkExpanding and Slack-ImgProxy. The audit reports a declared card that does not resolve as image_broken, and the checker's "Image loads" check fails and shows the HTTP status.

Two images, because a theme and a plugin both emit tags. Slack's pages do not say which of several og:image tags it takes. Make the page declare exactly one.

The crawler got a different page from the one you see. A bot challenge, a geo redirect or a login wall serves Slackbot its own HTML, and the unfurl shows that. Fetch the page the way Slackbot does:

curl -s --compressed \
  -A 'Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)' \
  https://your-site.com/your-page \
  | grep -oE '<meta (property|name)="(og|twitter):[^"]*" content="[^"]*"'

If the tags in that output differ from the ones in your browser's view-source, the problem is how your server treats this user agent, not your markup.

Detected by

image_missing, image_broken, and image_unverified when the audit could not tell either way.

Size, shape and how the card is drawn

What Slack documents

The pages I read give no minimum or maximum image size, aspect ratio or file size limit for Slack. They say the preview is "some micro-approximation of the content", which is as precise as they get. Anything stated as a Slack pixel rule, including the numbers in properOG's own mockup, is an observation about how the card tends to look, not a figure from Slack.

What to do about it

Design for the common denominator. A 1200 x 630 card is the size the other large-card platforms ask for, and it costs nothing to ship the same file to Slack. Keep the text on the card large and the important content away from the edges, because Slack draws the image inside a message, next to a coloured bar and a title, at a size much smaller than the file.

Keep the file small. A hard ceiling is not documented, but the fetch is a short step in posting a message, and a heavy file only adds risk. The audit's threshold is 500 KB: image_oversized (warning) fires above it, and the checker's File size check scores the same line. A flat designed card is often far under that.

How properOG models Slack

The checker's platform preview has a Slack row, and its mockup of a Slack unfurl is a rough picture, not Slack's renderer. It flags a card under 200 pixels wide as too small for a thumbnail, a threshold that is properOG's own and not Slack's, and warns when a large image will shrink a lot. Use it to judge legibility, and Slack itself for the final look.

Detected by

image_undersized (info) reports a card narrower than 1200 pixels. image_oversized reports a heavy one. twitter_card_small reports a summary card type over a large image: Slack documents reading Twitter Card tags, so keep the type at summary_large_image if you declare one, and leave the other tags matching the Open Graph set.

Slack app unfurls versus Slack's own

Classic unfurl is Slack crawling your page, which every section above is about. Your tags control it.

App unfurl happens when a Slack app is installed in the workspace and has registered your domain. Slack's docs describe the flow: a user posts a fully qualified URL on the registered domain, the app receives a link_shared event, and the app calls chat.unfurl to attach its own content, which can use Block Kit. The app needs the links:read and links:write scopes and a subscription to link_shared. The preview that results is whatever the app sent. Your Open Graph tags are not what it shows.

If the preview of your own domain looks nothing like your tags, ask whether a Slack app in that workspace handles the domain before touching the page.

Some facts from the documentation worth knowing when you build or debug one:

  • If two apps subscribe to link_shared for the same domain, only the originally installed app receives the event.
  • link_shared is not dispatched for messages posted by an app or integration, so an app does not receive it for its own messages.
  • Each URL can have a single attachment, and a repeated chat.unfurl call with the same channel and ts modifies it instead of adding more.

Slack does not state outright that an app's unfurl replaces the classic one, though describing classic unfurling as the case where "a workspace doesn't have a Slack app handler for a specific domain" implies it. If you build an app and still see a classic card, check that the domain is registered, that the event reaches your endpoint, and that you acknowledged it: the method reference lists cannot_unfurl_url for an unacknowledged link_shared event.

Slack shows a preview for you but not for a colleague

Symptom

The link unfurls on your screen and is bare text for someone else, or a link that unfurled yesterday does not today.

Cause and fix

The unfurl is partly a display setting, so the crawler can have done its job while the person looking sees nothing. Slack's help article lists where it can be switched off.

The viewer turned previews off. Slack says the preferences are under the profile picture menu in the sidebar, then Preferences, then Messages & media, in the Inline media & links section. The two checkboxes are "Show images and files from linked websites" and "Show text previews of linked websites". With them cleared, links display without previews for that person. Ask the colleague to check both. The article adds that previews for some third-party app links are not disabled by these settings.

Someone removed the preview from the message. On desktop, hovering over the preview and clicking the x on its left side removes it. On mobile, a long press on the link offers "Remove Link Preview".

The message was posted with unfurling off. Apps and integrations that post messages can opt out per message. In Slack's docs, setting both unfurl_links and unfurl_media to false stops the unfurl. unfurl_links covers text content, unfurl_media covers media, and the two are independent, so setting one does not stop a link of the other kind. A bot that posts your URLs and never shows a card may be sending these flags:

{
  "channel": "C0123456789",
  "text": "Release notes: https://your-site.com/changelog",
  "unfurl_links": false,
  "unfurl_media": false
}

The link text equals the URL. Slack's docs say it never unfurls a link whose label is a complete substring of the URL minus the protocol. A link to https://docs.slack.dev labelled "docs.slack.dev" will not unfurl, even with unfurl_links true. If you build messages with labelled links, label them with words.

The workspace restricts previews for apps. Slack's help article says owners and admins can restrict link previews from third-party apps. I found no workspace setting for classic unfurls of ordinary websites.

The same link was posted in this conversation in the past hour. See the cache section: Slack does not expand it again.

Fix it step by step with the Unfurl Debugger

Slack has a URL debugging tool at api.slack.com/tools/unfurl-debugger. Requested without a session, that address redirects to Slack's workspace sign-in, so you need to be signed in to a workspace to use it. Slack's help article says a web administrator can run a link through it, and a vendor's community answer describes it as showing classic unfurls, the ones made by crawling the page. I could not read the tool's output without signing in, so I describe it only that way. Slack's developer pages I read do not mention it, and Slack's feature retirement page does not list it. If it does not load for you, the fallback is a real post in a test channel.

Run these steps in order.

  1. Read the head as Slack does. Request the page with Slackbot's user agent and read the tags:
    curl -s --compressed \
      -A 'Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)' \
      https://your-site.com/your-page \
      | grep -oE '<meta (property|name)="(og|twitter):[^"]*" content="[^"]*"'
    You want one og:image with an absolute https URL, a title and description that match your twitter: tags, and nothing blocking the request.
  2. Check the image request. The same user agent plus a Range header, aimed at the image URL:
    curl -s -D - -o /dev/null \
      -H 'Range: bytes=0-524288' \
      -A 'Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots)' \
      https://your-site.com/og/your-page-v2.png
    Look for a 200 or 206 status and an image/* content type.
  3. Put a changed card at a new URL.
  4. Run the link through the Unfurl Debugger if you have access, and read the title, description and image it shows.
  5. Post the link in a test channel that has not seen it in the last hour. If the cache is the problem, wait about 30 minutes and post again.

Verify your fix

Check one URL. The checker scores the card's dimensions, file size and tags and shows a preview for each platform, Slack included. Enter the page you fixed, or check this guide's own card as an example. Its Slack row models how an unfurl may look at message size. It is not Slack's renderer, so use it to catch a missing, broken, tiny or heavy card before you test in Slack.

Audit the whole site. The site audit reads your sitemap, groups URLs into page templates, samples across them and reports the findings named in this guide with a fix for each.

Then ask Slack. Use the Unfurl Debugger if you can sign in, and a test channel post for the final look, after the cache has had its half hour.

Frequently Asked Questions

How long does Slack cache a link preview?

Slack's robots page says responses to its link expanding requests are cached globally across the service for around 30 minutes. Its help article adds that no preview expands when the same link was shared in the same conversation within the past hour. Slack gives no cache duration for its image proxy, and no documented way to force a refresh.

What user agent does Slack use to unfurl links?

Slackbot-LinkExpanding 1.0 (+https://api.slack.com/robots) fetches the page, using HTTP Range requests to read only part of it. Slack-ImgProxy 0.19 fetches and caches the images, and Slackbot 1.0 is the default robot for other requests. Slack does not honor robots.txt.

Which meta tags does Slack read for a link preview?

Slack's documentation says its crawler looks for oEmbed, Twitter Card and Open Graph metadata. It does not publish which one wins when they disagree, so set og:title, og:description and og:image and keep any twitter: tags identical to them.

Why does a Slack link preview show for me but not for a coworker?

The preview can be turned off per person in Preferences, Messages & media, by clearing 'Show images and files from linked websites' and 'Show text previews of linked websites'. It can also have been removed from the message, or the message was posted with unfurl_links and unfurl_media set to false.

Why does my Slack preview look different from my Open Graph tags?

A Slack app installed in the workspace may handle your domain. It receives a link_shared event and calls chat.unfurl to attach its own content, which is what the message then shows. Check for an app registered on your domain before changing the page.

Audit your site

Sample pages across every template in your sitemap and see which ones ship the wrong card, or none. Free, no account needed.

Related guides