A voluntary boundary file
robots.txt sits at the site root and declares which paths may be crawled. It is a voluntary convention: mainstream crawlers honour it and scrapers ignore it. What it blocks is fetching, not indexing, so if other pages link to an address you dislike, engines may still index it without content to show. Genuine removal needs noindex or an appropriate status code. The generator assembles agents, allow and disallow rules, crawl delay, sitemaps and host declaration, then simulates longest-match to say whether a path is permitted.
Steps
- List user agents, with an asterisk for all crawlers.
- Add disallow and allow paths, one per line, using allows to carve exceptions inside blocked directories.
- Set crawl delay and host declaration, knowing only some crawlers honour them.
- List sitemap addresses, one absolute URL per line.
- Enter a path in the tester to see whether it is allowed and which rule matched.
- Copy or download, upload to the root, then open it in a browser to confirm it is readable.
Longest match, wildcards and presets
Matching follows the longest rule, and at equal length allow beats disallow, which explains many cases of a blocked path still being fetched. The asterisk wildcards and the dollar sign anchors the end, and forgetting to anchor lets a rule catch deeper paths by surprise. Five presets cover the usual cases: fully open, blocking admin and search, blocking specific directories, multiple sitemaps, and a temporary full block. Crawl delay is politeness rather than optimisation; real load needs rate limiting or caching. Sitemap lines belong at the end, and rules independent of a specific agent belong at the top. Test real paths before shipping, not just the file text.
Common mistakes
Assuming a disallow removes a page from the index instead of needing noindex. Unanchored rules blocking subdirectories you wanted crawled. Writing an allow above a disallow and expecting it to win, when longest match governs. An exaggerated crawl delay that slows normal crawling. Uploading to a wrong path so the file returns the homepage HTML. And blocking stylesheets and scripts, which degrades rendering assessment.
Where robots.txt cannot help
Removing indexed pages requires noindex or deletion, not a disallow. Protecting sensitive directories only advertises them, so access control must do the work. Multiple domains and subdomains each need their own file. Staging sites should be fully blocked but must be reopened before launch. And any legal restriction on crawling belongs in terms and technical measures rather than a text file.