Skip to main content
toolsxulo

robots.txt Explained: Crawl Control, Syntax & Common Mistakes

Written by Toolsxulo Team · Last updated November 18, 2026

robots.txt looks like a two-line text file, but it sits at the boundary between what a search engine is allowed to crawl and what it's allowed to index - two different things that get confused constantly. This guide covers how the directives actually get interpreted, why a misplaced rule can silently block far more than intended, and where robots.txt fits alongside sitemaps and meta robots tags in a real SEO workflow.

Open the tool: Robots.txt Generator

Crawling and indexing are not the same permission

A Disallow rule tells a well-behaved crawler not to request a URL - it says nothing about whether that URL can appear in search results. If other pages link to a disallowed URL, search engines can still index it using just the link text and surrounding context, showing up in results with no title or snippet pulled from the page itself. That's the single most common misunderstanding about robots.txt: it's a crawl-traffic control, not a privacy or de-indexing tool. Keeping a page out of search results reliably requires a noindex meta tag or X-Robots-Tag header on the page itself, which in turn requires the page to be crawlable so the crawler can actually see that instruction - blocking it in robots.txt can paradoxically prevent a noindex tag from ever being read.

How crawlers pick which group applies to them

A robots.txt file is a sequence of independent groups, each opened by one or more User-agent lines followed by its own Allow and Disallow rules. When a crawler reads the file, it doesn't merge every group together - it looks for the group whose user-agent name most specifically matches its own identity, and only obeys that one group. A named group for "Googlebot" completely overrides the generic "*" group for Googlebot specifically, even if the wildcard group looks more permissive; a crawler that finds no matching named group falls back to "*". Within a group, when both an Allow and a Disallow rule could match the same URL, most crawlers apply whichever rule has the longer, more specific path pattern - which means rule order inside a group usually matters less than rule specificity.

Mistakes that quietly break crawlability

The most damaging mistake is blocking the CSS, JavaScript, or image directories a page needs in order to render, which stops search engines from seeing the page the way a real visitor would and can hurt how it's evaluated - modern crawlers render pages, they don't just parse raw HTML. Trailing slashes matter too: Disallow: /folder blocks /folder and /folder-2 and everything else that starts with that string, while Disallow: /folder/ blocks only paths inside that actual folder. An empty Disallow: line (nothing after the colon) means allow everything in that group, which is easy to write by accident when a field is left blank. And because path matching is case-sensitive, Disallow: /Private/ does nothing to protect /private/ - a subtle typo that leaves a folder fully crawlable.

Where the sitemap directive fits in

A Sitemap: line at the end of robots.txt is the one directive that isn't a crawl restriction - it's a pointer, telling any crawler that reads the file where to find the full list of URLs the site wants indexed. It's genuinely useful as a passive discovery mechanism since every well-behaved crawler checks robots.txt anyway, but it's not a replacement for submitting the same sitemap directly through Google Search Console or Bing Webmaster Tools, which gives indexing status and error feedback robots.txt alone never provides. A single file can list multiple Sitemap: lines, and the directive works independently of whatever Allow/Disallow groups sit above or below it in the file.

Frequently asked

Is robots.txt a good way to hide sensitive pages or admin URLs?
No - robots.txt is a publicly readable file at a predictable URL, so listing a path there is closer to announcing it than hiding it. Anyone, not just search engines, can read robots.txt and see exactly which folders you didn't want indexed. Actual protection requires authentication, a noindex tag, or keeping the URL out of robots.txt entirely.
Do search engines cache robots.txt, or read it on every request?
They cache it, typically for up to 24 hours, so a change you just uploaded won't necessarily affect crawling immediately. Google Search Console's robots.txt report can be used to request a faster recrawl of the file itself if you need an update to take effect sooner.
Does the Crawl-delay directive work in robots.txt?
Inconsistently - Bing and Yandex respect it, but Google ignores Crawl-delay entirely and instead manages crawl rate through Search Console settings and its own load-based algorithms. Don't rely on it as a universal way to slow down crawling across all search engines.
What happens if a site has no robots.txt file at all?
Crawlers treat a missing robots.txt (a 404 response) as full permission to crawl everything - it's functionally identical to a file that allows all user-agents and all paths. A robots.txt is only needed when you actually want to restrict something or point crawlers to a sitemap.

Try the tools