Developers · What Enforce robots.txt does
Developers
Enforce robots.txt
How Stattery reads your robots.txt, how it decides whether a bot was allowed to fetch a page, and which requests never count.
Reading The File
When Enforce robots.txt is on (Settings, Bots, robots.txt: Ban or Just tell me), the site’s own Stattery hub fetches https://<site>/robots.txt from time to time and whenever the setting is switched on. It identifies itself as:
StatteryRobotsCheck/1.0 (+https://stattery.com)
- A 2xx answer is parsed. An HTML page in its place (some sites answer every missing file with their home page) means no rules.
- A 4xx answer (no robots.txt) means no rules: every bot may fetch every page.
- A 5xx answer, a timeout or a network failure keeps the rules last read, and the Bots page shows that the last check failed.
- The file is parsed again only when its contents change.
Sitemap lines and lines Stattery doesn’t use (Crawl-delay, Host) are skipped.
How Rules Are Matched
Matching follows RFC 9309, the Robots Exclusion Protocol, as Google applies it.
- Groups. A group starts with one or more
User-agentlines. Its name must appear as a whole word in the bot’s user agent, case ignored:googlebotmatchesGooglebot-Image, butbotdoesn’t matchrobot. - Most specific group wins. A bot follows only the group with the longest name that matches it, and falls back to
*only when none does. Groups naming the same bot are combined. - Longest rule wins. Among
AllowandDisallowrules that match a path, the longest wins; on a tie,Allowwins. An emptyDisallow:allows everything. - Wildcards.
*matches any run of characters and$anchors the end of the URL. - Paths are case-sensitive and include the query string. Percent-escapes are compared in one form, so
%2fand%2Fare the same. - Rules before the first
User-agentline belong to no group and are ignored.
User-agent: * Disallow: /private/ Allow: /private/press/ Disallow: /*.pdf$ User-agent: Googlebot Disallow: /drafts/
Here Googlebot may fetch /private/ (it only follows its own group) but not /drafts/; every other bot may fetch /private/press/ but not the rest of /private/ or any URL ending in .pdf.
A newly added Disallow rule doesn’t count until bots have had time to read the change, and a removed Allow rule keeps allowing its pages for the same while.
Who Counts
Only requests the Edge Observer reports as bots are checked. Each bot is listed as one of:
- Verified crawler: its address belongs to the company its name claims (published address lists or a reverse name that points back). Never banned automatically; a notice goes to the people who can change the site’s Bots settings.
- Couldn’t be checked: the check couldn’t finish. Treated like a verified crawler.
- Unverified bot: a bot name Stattery can’t tie to its owner, or no known name at all.
- Fake name: a known crawler’s name from an address that crawler never uses.
In Ban mode, unverified bots and fake names that keep fetching closed pages are banned through the same ban list as Auto-ban, with the reason Ignored robots.txt, and the ban reaches the Edge Observer and the WordPress plugin like any other. In Just tell me mode nothing is banned and every bot gets a notice.
Crawler swarms. When a crowd of unknown bots fetches pages your robots.txt closes, those pages ask new, unknown visitors to try again later until the crowd goes away. Visitors the tracking script has already seen, signed-in users, verified search engines, the site’s own server and Stattery go through as usual, and nothing is banned for it. It’s on by default; turn it off per site under Settings, Bots, Rules.
These never count: /robots.txt itself, MCP routes (/mcp, the WordPress MCP routes) and Stattery’s own plugin routes, AI fetchers acting for a person (such as Claude-User), link previews, feed readers and uptime monitors, the site’s own server, and bots marked Mine.
Ignore It And Ban It
- Ignore It stops notices and robots.txt bans for that bot on that site.
- Ban It bans every address the bot was seen fetching closed pages from, with no end date, and any new address it shows up from later. It’s the only way a verified crawler is banned for robots.txt, and ban vetting leaves these bans alone.
- Undo clears either choice. Undoing Ban It doesn’t lift bans already made; unban those from Banned.