A robots.txt file can help manage crawler access, but a misplaced rule can also prevent search engines from fetching resources or pages you want them to see. It controls crawling, and indexing is separate: Google can still list a blocked URL that other pages link to. One bad line can hide a whole section from Google; one missing line can waste crawling on endless junk URLs. The HTTP Archive’s 2025 Web Almanac found that robots.txt requests returned a 200 status code for 84.9% of desktop and mobile sites.
What should you block in robots.txt?
Use robots.txt to manage crawling of URL patterns that do not need to be fetched, rather than treating it as a way to remove pages from Google’s index.
- On-site search results such as /search?q= or /?s=, which generate an almost unlimited set of URLs.
- Cart, checkout, account and wishlist pages, plus URLs carrying session IDs.
- Unprotected admin paths, though anyone can read robots.txt, so real security needs a login.
- Printer-friendly or alternate-view versions that copy the main pages.
- Faceted filter combinations your team has ruled out for crawling.
Staging and development hosts belong behind HTTP authentication. Google’s robots.txt specification states that rules “apply only to the host, protocol, and port number where the robots.txt file is hosted.” So your production file does nothing for staging.example.com, and each host needs its own file.
What should you never block in robots.txt?
Do not block resources or URLs that search engines need to render important pages and understand their content.
- Stylesheets and scripts. Googlebot renders pages like Chrome, so blocked.css or.js files break the layout it sees.
- /images/ or /wp-content/uploads/, unless keeping pictures out of Google Images is the goal.
- Pages you want ranking. Old migration rules and loose wildcards cause this more often than anything else.
- URLs you want removed from results. A noindex tag works only if Googlebot can fetch the page and read it, which a disallow prevents.
- Pages with strong backlinks, because Google cannot crawl them to follow where that link equity points.
How should you structure robots.txt for an enterprise site?
An enterprise robots.txt file should be short, commented and kept in version control such as Git.
- Write a comment above each rule giving its reason and the date someone added it.
- Sort rules into groups by job: crawl traps, duplicate content and temporary blocks.
- Reference the sitemap index with a Sitemap: directive.
- Combine rules with wildcards to stay far below Google’s 500 KiB cap; Google ignores content past that size.
- Check every wildcard before release. Disallow: /*?sort= blocks any URL containing that parameter, and a $ ties a pattern to the end of the URL.
- Set an AI crawler policy. GPTBot, ClaudeBot and Google-Extended take their own rules, and blocking Google-Extended does not affect Google Search.
Few sites have set AI crawler rules yet: the same Web Almanac chapter found GPTBot named in 4.5% of desktop robots.txt files and Google-Extended in 3.4%.
WordPress serves a virtual file that blocks /wp-admin/ but allows admin-ajax.php; we swap in a commented version. On Shopify, our ecommerce pick, you edit a robots.txt.liquid template.
How do you test robots.txt changes before deploying them?
Robots.txt changes should be tested against real URLs, checked with a before-and-after crawl and then watched in the server logs.
- Test the draft against two URL lists, must-crawl and must-block, in a robots.txt tester. Google retired its own tester in November 2023 for the Search Console robots.txt report, which lists files for your top 20 hosts, last crawl times and errors.
- Crawl a staging copy with the new file in place; your top pages should still return as crawlable.
- Diff the crawl before and after the change to see exactly which URLs switched status.
- Watch server logs and Crawl Stats for several days after launch; a sudden crawl drop in a main section means a bad rule.
After an urgent fix, request a recrawl in the robots.txt report, or Google may use its cached copy for up to a day.
How can our team at Emulent help?
At Emulent, we review robots.txt files during technical audits in enterprise SEO programs, removing rules that hide important content and closing crawl traps. A robots.txt error can drop whole sections from search within days, so every edit needs version control and a second reviewer. Contact our team at Emulent for a review.