Robots.txt Mistakes That Block Crawling: Audit & Fix Guide

Robots.txt should control crawler access, not act as a deindexing or security tool. This guide shows how to audit accidental sitewide blocks, broad path rules, user-agent conflicts, blocked resources and robots.txt availability failures, then verify each fix in Search Console.

Written by Founder of ScanMySEO
Published Updated Reading time11 min read

Robots.txt mistakes can block crawling—but not in the way many guides imply

A robots.txt file tells compliant crawlers which URLs they may request. A bad rule can stop Google from fetching an important page, prevent Google from rendering a page correctly, or—if the file itself becomes unavailable—slow or temporarily stop crawling across a host. But robots.txt is not a reliable way to remove an ordinary web page from Google Search, and fixing it does not guarantee higher rankings.

Google's current guidance is explicit: a URL blocked by robots.txt can still be indexed from links or other signals, even though Google cannot crawl its contents. If your objective is to keep a page out of search results, use an index-control method such as noindex and keep the page crawlable long enough for Google to see that rule. For confidential content, use authentication or another real access-control mechanism instead of robots.txt. See Google's robots.txt introduction and the IETF's Robots Exclusion Protocol standard.

For most small and medium-sized sites, the main risk is accidental blocking—not “running out of crawl budget.” Google's crawl-budget guide is aimed mainly at very large sites, rapidly changing sites and sites with many URLs stuck at “Discovered – currently not indexed.” If you are investigating crawl-budget concerns on a large ecommerce site, ScanMySEO's crawl budget decision matrix goes deeper into when crawl-budget work is actually justified.

The robots.txt mistakes worth checking first

Start with the failure mode you can actually observe. The table below separates crawl blocking from indexing control and highlights the fixes that are most likely to matter.

Common robots.txt mistakes, what they do, and the safer fix
Mistake What actually happens What to do
User-agent: * with Disallow: / left on production All matching crawlers are prevented from crawling the site unless a more specific user-agent group changes the outcome. Remove the sitewide block before launch and test representative URLs on the production hostname.
An overly broad path rule such as Disallow: /products Prefix matching can block more URLs than intended, such as /products, /products-old and /products/widget. Narrow the rule to the exact path pattern you mean to block and test near-match URLs.
Using robots.txt to keep an HTML page out of Google Google may still index the URL without crawling its contents, especially if other pages link to it. Use noindex for search exclusion, or authentication for private content.
Blocking a page that contains a noindex rule Google cannot crawl the page to discover the noindex instruction. Allow crawling and keep the noindex rule visible. See the ScanMySEO noindex guide for implementation choices.
Blocking CSS, JavaScript or other resources needed to understand the page Google may be unable to render or interpret the page as intended. Allow resources that materially affect content, layout or functionality. Blocking genuinely unimportant resources can still be reasonable.
Assuming a Googlebot-specific group inherits rules from User-agent: * Google uses the most specific matching user-agent group; a Googlebot-specific group is not combined with the global group. Make each specific user-agent group complete, or remove unnecessary crawler-specific groups.
Publishing robots.txt on the wrong host, protocol, port or path A robots.txt file only governs the host, protocol and port where it is served, and it must live at the top-level /robots.txt location. Check every live hostname you care about, such as https://example.com/robots.txt and https://www.example.com/robots.txt.
Returning 429, 5xx or network errors for robots.txt Google can slow or stop crawling while it cannot determine the site's crawl rules. Keep robots.txt reliably fetchable and monitor Search Console's robots.txt and Crawl Stats reports.
Relying on unsupported directives such as crawl-delay for Google Google ignores unsupported robots.txt fields. The file may look correct to a human while having no effect on Googlebot. Use only directives that the target crawler documents as supported.

Diagnosing the blockage: a systematic audit workflow

Do not start by rewriting the file. First prove which rule—or which delivery problem—is responsible.

  1. Fetch the production robots.txt file directly. Open https://your-domain.example/robots.txt in a private browser window. Confirm that it is the root file for the exact hostname and protocol you are auditing. A file at /blog/robots.txt does not govern /blog/, and a file on www.example.com does not automatically govern example.com.
  2. Check the HTTP response, not just the text you see. For Google, ordinary 4xx responses other than 429 are treated as if no crawl restrictions exist. By contrast, 429, 5xx, DNS failures and similar fetch failures can affect crawling. Google's current robots.txt specification explains the status-code and caching behaviour.
  3. Write down the URLs that must remain crawlable. Include the homepage, primary category/service pages, representative detail pages, key images where relevant, and CSS/JavaScript files needed to render those pages. This gives you a test set instead of relying on intuition.
  4. Match each URL against the actual rules. Google treats path values as case-sensitive, supports * and $ in paths, and chooses the most specific matching rule. A rule like Disallow: /fish also matches /fishheads; Disallow: /fish/ is narrower.
  5. Check user-agent grouping. If a file has a specific User-agent: Googlebot group, Googlebot follows that matching group rather than automatically inheriting rules from User-agent: *. This is a frequent source of unexpected access.
  6. Use Search Console to confirm Google's view. The robots.txt report shows files Google found and any warnings or errors. URL Inspection tells you whether crawling is allowed for an individual URL and whether the page fetch succeeded.
  7. Separate crawling from indexing. A robots.txt result of “blocked” answers a crawl question. A noindex tag or X-Robots-Tag answers an indexing question. Canonicals, redirects and HTTP status codes are separate signals again. Diagnose each layer rather than treating “not indexed” as a robots.txt problem by default.

Do not use robots.txt as a privacy control. The file is public, can reveal the paths you are trying to hide, and is only a crawler-access convention. Confidential pages should require authentication or another appropriate access-control method.

Implementing the fix: correct the smallest rule that is wrong

The safest robots.txt change is usually the smallest one that restores the intended crawl behaviour. Avoid replacing a working file with a “clean” template unless you understand every crawler-specific rule already in production.

Fix patterns for common robots.txt failures

1. Remove an accidental sitewide block

A staging rule sometimes reaches production unchanged:

User-agent: *
Disallow: /

If you do not need any crawl restrictions, removing the rule—or even returning no robots.txt file at all—is valid. If you keep the file for a sitemap or future rules, do not leave a production-wide Disallow: / in place.

2. Do not block the URL that carries the noindex instruction

This combination is self-defeating when the goal is to remove a page from Google Search:

# robots.txt
User-agent: *
Disallow: /thank-you/

# HTML on /thank-you/
<meta name="robots" content="noindex">

Because Google cannot crawl /thank-you/, it cannot reliably see the noindex tag. Allow the page to be crawled and keep the noindex instruction on the page (or send an equivalent X-Robots-Tag header). Google explicitly states that noindex in robots.txt itself is not supported. See Google's noindex guidance.

3. Tighten broad path matches instead of blocking a whole namespace

Robots path matching is prefix-based. If the intention is to block only URLs below a directory, include the trailing slash:

# Broader than many site owners expect
Disallow: /products

# Narrower: blocks URLs under /products/
Disallow: /products/

The first rule can match paths such as /products-old as well as /products/widget. Test the exact URLs you want blocked and several near matches before deploying.

4. Make crawler-specific groups self-contained

Consider this file:

User-agent: *
Disallow: /internal/

User-agent: Googlebot
Allow: /assets/

For Googlebot, the specific Googlebot group is the relevant group; the global Disallow: /internal/ is not automatically merged into it. If Googlebot must also be blocked from /internal/, include that rule in the Googlebot group—or remove the unnecessary Googlebot-specific group and use a global rule set that expresses the intended behaviour.

5. Keep resources crawlable when Google needs them to understand the page

Blocking every .js or .css file can make a rendered page look very different to Google from what users see. Do not unblock every asset blindly; instead, ask whether the resource is needed to understand meaningful content, layout or functionality. If it is, allow it.

6. Treat robots.txt availability as a site-level reliability dependency

Google generally caches robots.txt for up to 24 hours. If the file begins returning 5xx or equivalent network errors, Google says it will initially stop crawling the site while it retries the file. It may then use the last good cached version for a period while continuing to retry. This makes CDN, firewall and origin-server failures on /robots.txt more important than they may appear.

By contrast, an ordinary 404 for robots.txt is acceptable to Google and means there are no crawl restrictions. Do not create a fragile dynamic robots.txt endpoint if a simple static file—or no file—is sufficient.

7. Verify scope across hostnames and protocols

The rules at https://example.com/robots.txt apply to that host and protocol. They do not automatically control http://example.com/, https://www.example.com/ or a non-standard port. During migrations or domain changes, test the robots.txt file on every hostname that can still receive crawl requests.

8. Remove unsupported assumptions

Google's robots.txt parser documentation lists support for user-agent, allow, disallow and sitemap fields. Google does not support crawl-delay. It also ignores content beyond 500 KiB in a robots.txt file. If your file has grown into hundreds or thousands of generated rules, simplify the URL architecture or consolidate rules rather than assuming every line will be processed.

Robots.txt, noindex, redirects and access control solve different problems

Many robots.txt mistakes happen because the wrong mechanism is being used for the job. Use this decision table before changing a directive.

Choose the control that matches the outcome you need
Goal Usually use Why
Stop compliant crawlers requesting a low-value URL pattern robots.txt It controls crawler access to matching paths.
Keep an accessible HTML page out of Google Search noindex meta tag or X-Robots-Tag Google must be able to crawl the page to read the instruction.
Protect private or confidential content Authentication / authorization Robots.txt is public and is not an access-control system.
Remove a page permanently because the content no longer exists 404 or 410 The HTTP status tells crawlers the resource is gone.
Move a page to a new URL A server-side redirect, normally 301 or 308 A redirect communicates the new destination; robots.txt does not.
Tell crawlers where your XML sitemap is Sitemap: field and/or Search Console submission This helps discovery; a missing sitemap line is not itself a robots.txt blocking error.

Verification: prove the fix before you declare the incident resolved

Robots.txt changes are easy to make and easy to misread. Verify the result at three levels: file delivery, rule matching and real URL behaviour.

  1. Re-fetch the live file. Confirm that the production URL returns the intended text from the intended hostname. Check the HTTP status as well as the body.
  2. Use the Search Console robots.txt report. Confirm that Google can process the file and review any warnings or errors. For urgent changes, the report can request a recrawl of the robots.txt file. Google's robots.txt report documentation explains what the report covers.
  3. Inspect representative URLs. In URL Inspection, check Crawl allowed? and Page fetch for pages that should be crawlable. Test both a page you intend to allow and a page you intend to block.
  4. Confirm indexing controls separately. If the goal is deindexing, verify that Google can fetch the page and see the noindex rule. Do not interpret a robots.txt block as proof that a page has been removed from the index.
  5. Watch for cached rules. Google generally caches robots.txt for up to 24 hours, so a recently fixed file may not be reflected instantly everywhere. If the change is urgent, use Search Console's robots.txt recrawl workflow.
  6. Monitor the outcome that motivated the change. For a sitewide incident, check Page Indexing and Crawl Stats for recovery. For a single blocked page, URL Inspection is usually more useful than watching aggregate crawl counts.

If crawling resumes, that proves the crawl block was fixed. It does not prove the page will be indexed or rank better. Indexing and ranking depend on other signals after Google can access the content.

How to prevent the same robots.txt mistake from returning

  • Do not use robots.txt as the only staging safeguard. Protect non-public staging environments with authentication so an accidental robots.txt change cannot expose them to crawling.
  • Version-control the file where possible. Treat robots.txt like other production configuration so you can review, diff and roll back changes.
  • Test representative allow and block URLs before deployment. A rule that works for one example may catch nearby paths you did not intend to block.
  • Include robots.txt in launch and migration checklists. Sitewide Disallow: / errors are most damaging when a staging configuration survives a production release.
  • Monitor availability, not just syntax. A perfectly written file is still a problem if a firewall, CDN or origin returns 429, 5xx or intermittent network failures to Google.
  • Keep the file simple. Prefer a small number of comprehensible rules over large generated lists that are difficult to review and easy to contradict.

Practical rule: before adding a robots.txt directive, write down the exact URLs you want crawled and the exact URLs you want blocked. If you cannot describe that boundary clearly, the rule is probably too broad to deploy safely.

Robots.txt is powerful because a few lines can change crawler access across thousands of URLs. That is also why the best fixes are deliberate: confirm the scope, separate crawling from indexing, change only the rule that is wrong, and verify the result using Google's current tooling.

Hansel McKoy

Hansel McKoy is the founder of ScanMySEO and a technical SEO specialist with more than 10 years of experience across agency, in-house, public-sector, and founder-led roles.

Founder of ScanMySEO