How crawlers read the file
- A crawler finds its group. It looks for a
User-agentline with its own name. If it finds one, it follows that group and ignores the rest, including the group for all bots. - If there's no group for it, it follows
User-agent: *. If that's missing too, it may read everything. - The longest rule wins.
Allow: /blog/newsbeatsDisallow: /blogfor pages under /blog/news. - In a tie, Allow wins.
Two characters do special work: * matches anything, and $ marks the end of an address. Disallow: /*.pdf$ blocks every address ending in .pdf. Paths are case-sensitive, so /Admin and /admin are different.
If your robots.txt returns a "not found" error, crawlers may read everything. If it returns a server error, they stay out of the whole site until it's fixed.
Mistakes we look for
Disallow: /left in from when the site was being built, which hides the whole site.- A web page at /robots.txt instead of a text file.
- Rules above the first
User-agentline, which every crawler ignores. - Misspelled lines such as
Disalow. - Paths that don't start with a slash.
- Blocked style and script folders that Google needs to draw your pages.
Noindexin robots.txt, which Google stopped reading in 2019.- A sitemap written as a short address instead of a full one.