Robots.txt is a small text file with an outsized ability to cause damage. One stray line, such as a Disallow: / left over from a staging site, can block every search engine from every page. A rule that looks harmless can block a whole product category because of how wildcards match. And since crawlers follow only the most specific group of rules that names them, a rule you wrote for "all bots" may not apply to Googlebot at all. A robots.txt tester shows you exactly what each crawler can and cannot fetch before those mistakes reach production.
This guide explains how robots.txt rules are interpreted, how to test a file against a list of URLs with the free Robots.txt Tester on SEO Tools, and how to avoid the most common and costly mistakes.
What Is Robots.txt?
Robots.txt is a plain text file at the root of a domain, such as https://example.com/robots.txt, that tells crawlers which parts of the site they may request. A simple file looks like this:
User-agent: *
Disallow: /cart/
Disallow: /search/
Allow: /
Sitemap: https://example.com/sitemap.xml
The file is made of groups. Each group starts with one or more User-agent lines naming the crawlers it applies to, followed by Allow and Disallow rules for URL paths.
Robots.txt controls crawling, not indexing. A blocked URL can still appear in search results if other pages link to it, usually without a description. To keep a page out of the index, it must be crawlable and carry a noindex directive.
How Crawlers Read Robots.txt
Most problems come from misunderstanding these rules, which Google documents in its robots.txt specification.
A crawler follows only one group
A crawler looks for the group with the most specific User-agent line that matches its name, and follows only that group. If there is a User-agent: Googlebot group, Googlebot ignores the User-agent: * group completely.
That surprises many people. If you write careful rules under User-agent: * and then add a small User-agent: Googlebot group with one rule, Googlebot now follows only that one rule.
The most specific rule wins
Within a group, when several rules match a URL, the rule with the longest matching path wins. If an Allow and a Disallow rule are the same length, Allow wins.
User-agent: *
Disallow: /shop/
Allow: /shop/shoes/
Here, /shop/shoes/aero-glide/ is allowed, because /shop/shoes/ is longer than /shop/.
Wildcards
*matches any sequence of characters$marks the end of the URL
Disallow: /*?sort= blocks any URL containing ?sort=. Disallow: /*.pdf$ blocks URLs ending in .pdf.
Paths are case-sensitive
Disallow: /Admin/ does not block /admin/.
Some directives are ignored
Google ignores Crawl-delay and does not support Noindex in robots.txt. If your file relies on either, it is not doing what you think for Google.
Tip: Blocking a URL in robots.txt does not remove it from Google. If you want a page out of the index, let it be crawled and add a noindex tag.
How to Use the Robots.txt Tester
You need your robots.txt content and a list of URLs to test.
- Paste robots.txt. Copy the live file from
yoursite.com/robots.txt, or paste the version you plan to deploy. - Paste test URLs. Include pages that must stay crawlable, such as the home page, categories and products, and those you mean to block, such as internal search results, the cart and filter URLs.
- Read the matrix. For each URL, the tester shows whether Googlebot, Bingbot and the main AI crawlers are allowed or blocked, and the exact rule that decides it.
- Fix and re-test. Adjust rules until every important URL is allowed and every unwanted URL is blocked.
The Robots.txt Tester how-to page includes a sample list of URLs worth testing for typical sites.
What the Tester Shows
- A matrix of URLs and crawlers, with allowed or blocked for each combination
- The deciding rule for each result, including which group was used and which line matched
- Warnings for directives Google ignores, such as
Crawl-delayandNoindex - Syntax problems, such as rules outside any group or misspelled directives
Seeing the deciding rule is what makes the tester useful. When a URL is blocked unexpectedly, you know immediately which line is responsible.
Building a Good Test List
The quality of your test depends on the URLs you test. Include:
URLs that must be allowed
- Home page
- Key category and product pages
- Blog posts and guides
- CSS, JavaScript and image files that pages need to render
- Your XML sitemap
URLs you intend to block
- Internal search results (
/search?q=) - Cart, checkout and account pages
- Sorting and filtering parameters you do not want crawled
- Admin and login paths
- Staging or test folders
Edge cases
- URLs with and without trailing slashes
- URLs with upper-case letters
- URLs with query strings
- URLs in subfolders that share a prefix with blocked folders, such as
/shop-guide/when/shopis blocked
That last case matters. Disallow: /shop (without a trailing slash) blocks /shop-guide/ too, because rules match by prefix.
Worked Examples
A staging rule that went live
Imagine a site that launches with Disallow: / left over from its staging environment. The tester shows every URL blocked for every crawler, decided by the line Disallow: / under User-agent: *. The team removes the line, re-tests to confirm every important URL is allowed, and redeploys. Because they caught it quickly, traffic returns within days.
Blocking AI crawlers but not search
Now picture a publisher that wants to block GPTBot and ClaudeBot from its articles while keeping Googlebot and Bingbot. It adds groups for each AI crawler with Disallow: /. The tester confirms that articles are allowed for Googlebot and Bingbot and blocked for the two AI crawlers, and that the existing User-agent: * rules still apply to search crawlers as intended.
Common Robots.txt Patterns
Block internal search
User-agent: *
Disallow: /search
Disallow: /*?q=
Block sorting parameters but not filters
User-agent: *
Disallow: /*?sort=
Disallow: /*&sort=
Block a folder but allow one subfolder
User-agent: *
Disallow: /resources/
Allow: /resources/guides/
Block AI training crawlers
User-agent: GPTBot
Disallow: /
User-agent: CCBot
Disallow: /
User-agent: Google-Extended
Disallow: /
Always test patterns like these against real URLs from your site before deploying.
Robots.txt and Rendering
Search engines render pages much like a browser does. If robots.txt blocks the CSS or JavaScript files a page needs, Google may not see the page as users do, which can affect how it understands and ranks the content. Test a few of your asset URLs, such as /wp-content/themes/ or /assets/, to make sure they are allowed.
Robots.txt for Common Platforms
Each platform has its own defaults and quirks. Knowing them helps you write and test rules that fit.
WordPress
WordPress generates a virtual robots.txt if no physical file exists, usually disallowing /wp-admin/ while allowing /wp-admin/admin-ajax.php. SEO plugins often let you edit it from the dashboard. Check that the "Discourage search engines from indexing this site" setting is off on live sites; it adds noindex rather than a robots.txt block in recent versions, but it is still a frequent cause of launch-day disasters.
Shopify
Shopify provides a default robots.txt that blocks the cart, checkout, internal search and some sorting and filtering URLs. You can customise it with a robots.txt.liquid template. Test any customisation carefully, because the default rules handle many duplicate URL patterns for you.
Magento and other large ecommerce platforms
These generate many parameter URLs from layered navigation. Robots.txt rules for sorting, display modes and session parameters are common, but be careful not to block filter combinations you want indexed as landing pages.
Headless and JavaScript frameworks
Sites built with Next.js, Nuxt and similar frameworks often serve robots.txt from a route or static file. Make sure the production build serves the production file, not a development version with Disallow: /.
Staging environments
Staging sites should be protected with authentication, not just robots.txt. If you do use Disallow: / on staging, add a deployment check that fails if that line reaches production.
Testing for Multiple Hosts
Robots.txt applies per host. www.example.com/robots.txt does not control shop.example.com or blog.example.com. If your site uses subdomains, each needs its own file, and each should be tested against its own URLs. The same applies to separate protocols: the HTTPS file governs HTTPS URLs.
Before and After Every Change
Robots.txt changes are high-risk because their effects are site-wide and not always immediately visible. A safe process:
- Copy the current live file
- Make changes in a copy
- Test both versions against the same URL list
- Compare the results to see exactly which URLs change status
- Deploy only when every change is intended
- Fetch the live file afterwards to confirm the right version is deployed
Comparing old and new versions side by side catches unintended changes, especially on large files edited by several people over the years.
Where to Find Your Live File
Your robots.txt always sits at the root of each host: https://www.example.com/robots.txt. Subdomains such as shop.example.com and blog.example.com each need their own file. Search Console's robots.txt report shows which versions Google last fetched for each host and whether it found any errors.
Common Mistakes
- Leaving
Disallow: /from staging. The most damaging and most common mistake. - Assuming
User-agent: *applies to every crawler. Not if a more specific group exists. - Blocking CSS and JavaScript. Search engines need them to render pages.
- Using robots.txt to deindex pages. Use noindex instead.
- Prefix surprises.
/shopblocks/shop-guide/. - Case mismatches. Paths are case-sensitive.
- Relying on Crawl-delay or Noindex for Google.
Frequently Asked Questions
Does robots.txt stop a page appearing in Google?
No. It stops crawling. A blocked page can still be indexed from links. Use noindex on a crawlable page to keep it out of results.
How quickly does Google pick up robots.txt changes?
Google generally caches robots.txt for up to 24 hours, so changes usually take effect within a day.
Do AI crawlers respect robots.txt?
Major AI companies say their crawlers do. Some smaller bots do not.
Can I test a robots.txt file before it goes live?
Yes. Paste the planned version into the tester along with your test URLs.
What happens if robots.txt is missing?
Crawlers assume everything is allowed. A missing file is not a problem in itself, though a 5xx error when fetching it can cause Google to pause crawling.
Robots.txt mistakes are easy to make and expensive to discover in traffic reports. Paste your file and a list of your most important URLs into the Robots.txt Tester, confirm every crawler sees what you intend, and make testing a step in every change you deploy.
Printed from seo-serps.com — https://seo-serps.com/seo-search-marketing/robots-txt-tester-check-which-urls-googlebot-and-ai-crawlers-can-access/ — updated November 23, 2026.