A robots.txt tester checks whether a search engine bot is allowed to crawl a URL on a website, based on the rules in that site’s robots.txt file. Enter a domain and an optional path above to see if Googlebot, Bingbot and other bots are allowed or blocked, read the full file, and build a new one with the generator.
Robots.txt is a small text file with a big reach. One wrong line can stop Google from crawling an entire site. It happens more often than you would think, usually after a site moves from a staging server where everything was blocked.
Key facts
- Robots.txt must sit at the root of the domain, for example example.com/robots.txt.
- Disallow stops crawling of a path but does not remove a page from Google.
- When Allow and Disallow both match, Google follows the more specific, longer rule.
- Google reads up to 500 KiB of a robots.txt file and ignores Crawl-delay.
- Blocking Google-Extended affects Google AI training, not Google Search rankings.
How to test a robots.txt file
- Type the domain, for example example.com.
- Add a path such as /blog/ if you want to test one section.
- Press Go and read whether each bot is allowed or blocked.
- Scroll down to read the full file and the rule that matched.
The rules in plain words
| Line | What it does | Example |
|---|---|---|
| User-agent | Which bot the next rules apply to | User-agent: Googlebot |
| Disallow | Blocks crawling of a path | Disallow: /wp-admin/ |
| Allow | Makes an exception inside a blocked path | Allow: /wp-admin/admin-ajax.php |
| Sitemap | Tells bots where your sitemap lives | Sitemap: https://example.com/sitemap_index.xml |
| * | Matches any characters | Disallow: /*?s= |
| $ | Matches the end of the URL | Disallow: /*.pdf$ |
When an Allow and a Disallow rule both match a URL, Google follows the more specific one, which means the longer rule. That is why Allow: /wp-admin/admin-ajax.php works inside Disallow: /wp-admin/.
Robots.txt blocks crawling, not indexing
This is the most common misunderstanding. If you block a page in robots.txt, Google stops reading it, but it can still index the bare URL if other sites link to it. To keep a page out of search results, let Google crawl it and add a noindex tag instead. Blocking and noindexing the same page does not work, because Google never sees the noindex.
A safe robots.txt for WordPress
Most WordPress sites need very little. Block the admin area, allow the AJAX file that themes and plugins use, and point to your sitemap:
User-agent: *
Disallow: /wp-admin/
Allow: /wp-admin/admin-ajax.php
Sitemap: https://example.com/sitemap_index.xml
Do not block /wp-content/ or /wp-includes/. Google needs your CSS and JavaScript to render the page and judge it for mobile.
Can I block AI crawlers?
Yes. AI companies publish the names of their crawlers, such as GPTBot from OpenAI, ClaudeBot from Anthropic, CCBot from Common Crawl and Google-Extended, which controls use of your content for Google’s AI models. Tick the option in the generator to add rules for the common ones. Blocking Google-Extended does not affect your rankings in Google Search, because normal search crawling uses Googlebot.
Think before you block, though. Some AI tools cite and link to sources. If you want your brand to appear in AI answers, blocking every AI bot works against that.
After any site migration, open yourdomain.com/robots.txt in a browser. If you see
Disallow: /underUser-agent: *, your whole site is blocked. Remove that line first and request indexing in Search Console.
Three robots.txt mistakes we see most
- Disallow: / left over from staging. The whole site disappears from Google within weeks.
- Blocking CSS and JavaScript folders. Google cannot render the page and may treat it as broken on mobile.
- Blocking pages to remove them from Google. They stay indexed as bare URLs. Use noindex instead.
Robots.txt rules for common situations
| Goal | Rule |
|---|---|
| Block internal search result pages | Disallow: /?s= |
| Block a staging folder | Disallow: /staging/ |
| Block PDF files for all bots | Disallow: /*.pdf$ |
| Block one bot completely | User-agent: GPTBot then Disallow: / |
| Allow everything | An empty Disallow: line |
Remember the rule from earlier: these lines stop crawling only. Pages you want gone from Google need a noindex tag, and Google has to be allowed to crawl them to see it.
How to check your robots.txt in Search Console
Google Search Console has a robots.txt report under Settings. It shows the version Google last fetched, when it fetched it and any lines it could not read. If you just changed the file, you can ask Google to fetch it again from that report.
Who uses this tool
Site owners use it after a migration or a theme change, when a stray Disallow line can hide the whole site. SEO consultants use it in audits to confirm that important folders are open and junk URLs are closed. Developers use the generator to ship a clean file with a new site. Publishers use it to decide which AI crawlers they allow. A two minute check here can save weeks of lost traffic.
Frequently asked questions
Where must robots.txt be placed?
At the root of the domain: https://example.com/robots.txt. A file in a folder is ignored. Each subdomain needs its own file.
Is there a size limit?
Google reads the first 500 KiB of the file. Real files are almost always far smaller.
Does Google follow Crawl-delay?
No. Google ignores Crawl-delay. Bing and some other bots respect it.
Is robots.txt private?
No. Anyone can read it, so never list secret folders in it. Protect private areas with a login instead.
What if a site has no robots.txt?
Bots treat a missing file as permission to crawl everything. That is fine for many small sites, but adding a sitemap line still helps.
Next, check that the pages you allow are in your sitemap with the sitemap checker, and that none of them carry a stray noindex using the SEO audit.