How robots.txt rules work
| Rule | Meaning |
|---|---|
| User-agent: * | The group applies to every crawler not named elsewhere |
| Disallow: /admin/ | Do not crawl URLs starting with /admin/ |
| Allow: /admin/help/ | Exception inside a disallowed folder |
| Disallow: /*.pdf$ | Any URL ending in .pdf |
| Disallow: | Empty – nothing is blocked |
| Sitemap: https://… | Where your XML sitemap is (absolute URL) |
When several rules match, the longest (most specific) one wins; if an Allow and a Disallow are equally long, Allow wins. This is how Google and the RFC 9309 standard handle conflicts.
Common mistakes
- Using Disallow to hide a page from Google – it can still be indexed from links. Use noindex instead and leave it crawlable.
- Blocking CSS, JavaScript or images that pages need to render.
- Leaving “Disallow: /” from a staging site on the live site.
- Forgetting that each subdomain needs its own robots.txt.
Related tools
Frequently asked questions
Where does robots.txt go?
At the root of the host, e.g. https://example.com/robots.txt. Subdomains need their own file.
Does robots.txt remove pages from Google?
No – it stops crawling. Blocked pages can still appear if linked. Use noindex for removal.
Is robots.txt required?
No, but it is useful for blocking low-value areas and listing sitemaps.
What does an empty Disallow mean?
Nothing is blocked.
Are paths case-sensitive?
Yes – /Admin/ and /admin/ are different.
Can I use wildcards?
Yes: * matches any characters and $ marks the end of the URL.
Which rule wins when two match?
The longest matching rule; on a tie, Allow wins.
Does Google support Crawl-delay?
No. Bing and some other crawlers do.
Should I block AI crawlers?
It is a business choice: blocking training bots does not affect Google Search; blocking AI search bots reduces visibility in AI assistants.
Does blocking stop bad bots?
No – robots.txt is voluntary. Use a firewall for abusive bots.
How big can the file be?
Google reads the first 500 KiB.
Should I block /wp-admin/?
Many WordPress sites block /wp-admin/ but allow /wp-admin/admin-ajax.php.
Can I list several sitemaps?
Yes – one Sitemap line each.
How fast do changes apply?
Google usually refreshes its cached copy within about a day.
Is it a security measure?
No – the file is public and lists the paths you block. Protect private areas with logins.
What encoding should it use?
Plain UTF-8 text.
Can I test the file?
Yes, with the Robots.txt Tester.
Is it free?
Yes – no sign-up, no limits and no watermark.
Does it work on a phone?
Yes, in current mobile browsers; the layout adapts to small screens.
Is my content sent anywhere?
No. The tool runs in your browser and nothing you type is uploaded.
Last reviewed: 8 November 2026.