Slackbot-LinkExpanding
Last reviewed
Slackbot-LinkExpanding is the bot Slack uses when someone posts a link in a channel. Slack documents that it fetches as little of the page as it can, using HTTP Range headers, to read the meta tags for the preview.
| Operator | Slack |
|---|---|
| Type | Link preview bot |
| User agent contains | Slackbot-LinkExpanding |
| Purpose | Fetches links that Slack users post in channels, reading as little of the page as it can to get its meta tags. |
| robots.txt | Does not honor robots.txt. Slack says it is not a crawler and acts on behalf of a person. (source) |
| Runs JavaScript | Not documented by the operator |
| How to verify it | Not documented: no published IP list or reverse DNS rule. Prebaked reports its visits as unverified. |
| Official documentation | api.slack.com/robots |
What it sees on a JavaScript site
Slack does not document whether Slackbot-LinkExpanding runs JavaScript. It does document that the bot reads meta tags from as little of the page as it can. So the tags need to be in the HTML response, near the top: tags that JavaScript adds later are not part of what it reads.
How to allow or block it in robots.txt
Slack documents that it does not honor robots.txt, because it is not a crawler and acts on behalf of a person. A Slackbot-LinkExpanding group in robots.txt will not stop link previews.
# Slack documents that it does not honor robots.txt,
# so this group does not stop link previews.
User-agent: Slackbot-LinkExpanding
Disallow: /
robots.txt controls whether a bot may fetch a page. It does not change what the bot sees once it fetches it. For the full syntax, see robots.txt.
How Prebaked serves it
Your Prebaked integration looks at the User-Agent header of each request. When it contains Slackbot-LinkExpanding, the request gets the rendered HTML of your page from Prebaked: the same content a visitor sees after the scripts run. Every other visitor gets your site directly. Prebaked does not change the content for crawlers. The visit shows up in your request log as unverified, because Slackbot-LinkExpanding cannot be checked by IP. For a link preview this means the title, description and Open Graph tags are in the HTML, even when your app sets them with JavaScript.
To see what a bot that does not run JavaScript gets from your page, run the free checker. The full list of bots Prebaked serves is on Crawlers.
Can AI search cite your site? Check it free
FAQ
Does Slackbot-LinkExpanding run JavaScript?
Not documented. Slack does not publish this. Put the content and meta tags that matter in the HTML response, and the answer stops mattering.
Can I stop Slack from showing previews of my links?
Not with robots.txt. Slack documents that it does not honor robots.txt for these fetches.
Can I verify that a visit is really from Slackbot-LinkExpanding?
Not reliably. The operator publishes no IP list or reverse DNS rule for Slackbot-LinkExpanding, so a user agent that says Slackbot-LinkExpanding could come from anyone. Prebaked still serves the rendered page, and reports these visits as unverified.