How it's written
The file is grouped by user-agent (the crawler's name) with Allow and Disallow rules for paths, plus optional Sitemap lines. For example, a group for GPTBot with "Disallow: /" blocks that bot entirely, while "User-agent: *" sets the default for everyone else.
What it doesn't do
- It doesn't hide pages from people or stop bad bots that ignore it.
- It doesn't remove indexed pages. A blocked page can still appear in results if other sites link to it. Use a noindex tag (on a crawlable page) for that.
- It doesn't override firewall or CDN rules, which can block bots before they ever read the file.
Common mistakes
Leaving a staging site's "Disallow: /" in place at launch, blocking CSS and JavaScript files Google needs to render pages, and blocking AI search bots by copying a "block all AI" template. Test changes in Search Console's robots.txt report before relying on them.
In practice
A sensible small-business robots.txt allows all major search and AI search bots, disallows private areas such as /admin/ and large media folders if bandwidth matters, blocks scrapers that bring no benefit, and ends with a Sitemap line. Keep a comment at the top explaining the policy so whoever edits it next knows why each rule exists.

