Sign in

SEO tools

robots.txt Tester

Test URLs against a robots.txt file for Google, Bing and AI crawlers. See the line that allows or blocks each one, and try edits before they go live.

We read the robots.txt at the root of that site.

About robots.txt

How Google reads a robots.txt file

robots.txt is a plain text file at the root of your site that tells crawlers which addresses they may request. Google retired the robots.txt Tester in Search Console in December 2023; this tester follows the rules Google publishes for reading the file and the robots.txt standard, RFC 9309.

  • Rules come in groupsA group starts with one or more User-agent lines that name crawlers, followed by its Allow and Disallow rules. Each crawler follows one group.
  • The most specific name winsA crawler follows the group that names it, and the * group only when none does. Google merges groups that name the same crawler. Once a crawler has a group of its own, the * group no longer applies to it at all.
  • The longest rule winsWhen several rules match a URL, the one with the most characters decides. If an Allow rule and a Disallow rule are the same length, Allow wins.
  • * and $* matches any run of characters. $ at the end of a rule marks the end of the URL, so Disallow: /*.pdf$ blocks every address that ends in .pdf.
  • Paths are case-sensitiveDisallow: /Shop/ does not block /shop/. Crawler names are the opposite: Googlebot and googlebot are the same.
  • Rules match the path and queryA rule is compared with the part of the address after the domain, like /search?q=shoes. The domain and anything after # never count.
  • Google reads 500 KiBAnything after the first 500 KiB of the file is ignored.
  • A 4xx and a 5xx mean opposite thingsIf robots.txt returns 404 or another 4xx error (except 429), Google crawls as if there were no file. A 5xx or 429 error makes Google stop crawling for up to 12 hours. After that it uses the last copy it read, for up to 30 days.
Example robots.txt
# Crawlers without a group of their own
User-agent: *
Disallow: /cart/
Disallow: /search
Allow: /search/help
​
# Googlebot follows only this group
User-agent: Googlebot
Disallow: /drafts/
​
Sitemap: https://example.com/sitemap.xml

How crawlers read it

  • /search/help is allowed for BingbotAllow: /search/help (12 characters) is longer than Disallow: /search (7), so the Allow rule wins.
  • /search?q=shoes is blocked for BingbotOnly Disallow: /search matches it.
  • /cart/ is allowed for GooglebotGooglebot has a group of its own, so the * rules don't apply to it.

Mistakes this tester flags

  • Disallow: / for every crawlerOne line in the * group shuts every crawler without a group of its own out of the whole site.
  • Blocked CSS and JavaScriptGoogle needs these files to render your pages. Blocking a folder like /wp-includes/ or /assets/ can hide how a page really looks.
  • Full addresses and missing slashesDisallow: https://example.com/private/ and Disallow: private/ never match. A rule starts with / or *.
  • Misspelled namesGoogle forgives Dissallow and User agent, but other crawlers skip lines they can't read.
  • Noindex in robots.txtGoogle stopped reading it in September 2019. Use a noindex tag on the page instead.
  • Wildcards and versions in crawler namesGoogle reads Googlebot* and Googlebot/2.1 as plain Googlebot, but other crawlers may not. A * in a name is not a wildcard: only a plain * means every crawler.
  • Names that only look rightUnder Google's rules and RFC 9309, a group for claude doesn't apply to ClaudeBot: names must match exactly, apart from capital letters. Some crawlers match loosely, so don't rely on it either way.
  • Blocking AI search by mistakeBlocking OAI-SearchBot, Claude-SearchBot or PerplexityBot can keep your pages out of those AI answers, even if you only meant to stop training.

Questions people ask

Does robots.txt remove a page from Google?

No. robots.txt controls crawling, not indexing. A blocked page can still show up in search results when other pages link to it, usually without a description.

To keep a page out of Google, let Google crawl it and add a noindex robots meta tag or an X-Robots-Tag header. Google can only see a noindex tag on a page it is allowed to crawl.

How do I block AI training but stay in AI answers?

Block the crawlers that collect training data, and leave the search crawlers alone. GPTBot (OpenAI) and ClaudeBot (Anthropic) are about training. OAI-SearchBot, Claude-SearchBot and PerplexityBot find pages for ChatGPT search, Claude search and Perplexity.

Block AI training only
User-agent: GPTBot
User-agent: ClaudeBot
Disallow: /

Google-Extended is different: it covers training and also whether Google's AI apps may use your pages as sources for their answers, so leave it out if you want to appear there. It doesn't affect Google Search.

OAI-SearchBot, Claude-SearchBot and PerplexityBot aren't named there, so they keep following your * group. If that group blocks them, give them a group of their own with Allow: /, and copy into it any Disallow lines you still want them to follow.

Why does Google still show a URL I blocked?

Blocking stops Google from crawling the page, not from listing it. If other pages link to the address, Google can index it without reading it, and the result shows no description. To remove it, unblock the page so Google can crawl it, then add a noindex tag or make the address return 404 or 410. For a quick, temporary hide, use the Removals tool in Google Search Console.

Where must the robots.txt file be?

At the root of each host, at /robots.txt: https://example.com/robots.txt. It applies only to that protocol, host and port, so https://shop.example.com and http://example.com each need their own file. A robots.txt in a subfolder is ignored.

How do I edit robots.txt on Shopify, WordPress, Wix or Squarespace?
  • Shopify creates the file for you. To change it, add a robots.txt.liquid template to your theme (Online Store, Themes, Edit code).
  • WordPress serves a virtual file until you add a real one. Upload a robots.txt to your site's root folder, or use an SEO plugin with a robots.txt editor, such as Yoast SEO.
  • Wix has a robots.txt editor in its SEO settings.
  • Squarespace manages the file and doesn't let you edit it; its crawler settings can block known AI crawlers.
How long until Google sees my changes?

Google generally caches robots.txt for up to 24 hours, so a change can take about a day to apply. To ask sooner, request a recrawl in the robots.txt report in Google Search Console.

Check next

RankHouse AI agent

Want this fixed for you every month?

RankHouse's AI agent audits and fixes your site. Every month it runs a full SEO audit, fixes what it can and lists the rest in plain English for your developer.