Skip to main content

robots.txt Is Not an Indexing Directive

· 7 min read
Indexation audit for large websites

Adding a URL to robots.txt feels like putting a page in a cupboard. You write the line, you deploy, and the sense is that the page has been dealt with. It has not. The page is still reachable by anyone with the URL, it may still be sitting in Google's index, and if it has been there long enough it may still be appearing in results as a bare link with nothing underneath it. The cupboard has a hole in it, and it always did.

The confusion is easy to fall into because the two mechanisms share a file, a syntax and a plausible-looking syntax error. A line that reads like a prohibition, sits next to a directive that actually is one, and gets copied between projects for years without anyone checking which one it was.

robots.txt is a crawling control, not an indexing control. That single distinction explains almost every surprise people hit with it, and it is worth being blunt about because the file is one of the most widely misread artefacts in the whole of technical SEO.

What robots.txt actually controls​

robots.txt is read by the crawler before it requests a URL. It answers one question: should I spend a request on this address? If the answer is yes, the crawler fetches the page and reads it. If the answer is no, the crawler does not fetch it, which means it cannot see anything inside it, including any instruction the page might be carrying.

That last point is the one that catches people. A directive inside the page is invisible to a crawler that has been told not to fetch the page. So a noindex tag placed on a URL that is also blocked in robots.txt is a tag nobody will ever read. The instruction and the block cancel each other out, and the URL sits in the index untouched.

Google's own documentation sets out the same rule. The introduction to robots.txt in the Search documentation is the reference if you want the primary source rather than a summary.

User-agent: *
Disallow: /account/
Disallow: /basket/
Disallow: /search?
Disallow: /tmp-staging/

User-agent: BadBot
Disallow: /

This file says: do not fetch these areas. It says nothing about whether they are in the index, and it will not remove anything from the index.

Why a blocked URL still shows up in results​

Because blocking crawling and being in the index are independent states. Google can know about a URL for several reasons: it was crawled before the block went in, it was linked from an external site, it appears in a sitemap that was submitted before the block, it was submitted through the Search Console API, or it was reported by a user. Once an index entry exists, blocking the fetch does not remove it. The crawler simply stops coming back to check, so the entry sits there with the content it had at the time.

The visible result is the familiar one: a bare link, the URL as the title, no snippet, no thumbnail, no description. It occupies space in the results and generates almost no click-through, and it can persist for a long time because nothing is going back to refresh it. If you block a path that used to be public and heavily linked, you have arguably made the result worse than leaving it alone, because the cached fragment is worse than a live page.

When blocking is the right move​

Blocking is exactly right for areas that should not exist as far as a crawler is concerned and where nobody will ever link to them from outside.

A staging or preview subdomain is the clearest case. There is no reason for Google to read it, no reason for it to be indexed, and a real risk that a copy of production content gets published by accident. Add the block before you launch, not after.

Cart, checkout, account and order pages follow the same logic. They are behind authentication or irrelevant to search, they generate parameters without limit, and they consume requests that could go elsewhere.

Parameter spaces that fan out combinatorially are the third case. Blocking a bare search query string or a sort parameter stops an unbounded crawl of URLs that can never rank.

The rule of thumb is simple. If nobody would ever be upset to see the URL missing from results, and no meaningful traffic reaches it, block it.

When blocking is the wrong move​

Blocking is the wrong move whenever the URL has earned links, appears in search results already, or is the only version of content that exists. In those cases you have removed the crawler's ability to see your own instruction, and you have frozen whatever Google already knew about the page.

It is also the wrong move for pages you simply want to stop ranking for a query. Blocking does not deindex, it de-crawls. If a page ranks badly and you block it, you have not fixed the ranking, you have removed your ability to change it.

The deeper problem is that the block is invisible to your own audit. Once a path is blocked, your crawlers stop fetching it too, which means you can no longer see what state it is in. You have made the thing you were trying to measure unmeasurable. That is the argument for treating robots.txt as a small, deliberate and reversible tool rather than a filing cabinet.

Reading robots.txt as a statement of intent​

A useful habit is to read the file as a description of what the team decided, not as a description of what is happening. Every line answers a question someone asked at some point.

Read the file and ask, for each block: does this still exist, is it still generating URLs, and did anyone ever verify that the block was the right tool. On most large sites the file has accreted. It grew one line at a time, each line a reaction to a crawl report rather than a considered decision, and nobody has read the whole thing since. Some of it will be blocking staging hosts that were decommissioned two years ago. Some of it will be blocking a content directory that your best page lives in.

The categories worth writing down are the ones in the inspection vocabulary: URLs reported as ROBOTS_BLOCKED and URLs reported as NOINDEX_BLOCKED. The second is the more interesting of the pair, because it means the crawler got through, read a noindex directive and declined. A NOINDEX_BLOCKED result is not a failure of the mechanism. It is the mechanism working.

Change the fragments, not the file​

If you do need to change robots.txt, change it the way you would change any other generated artefact: as a fragment, reviewed, applied by whoever owns the web server. PruneSEO will generate a robots.txt fragment as one of its artifacts, along with a noindex directive set and the rest of the files needed for a remediation campaign. It does not touch your server, and it could not if it wanted to. You review the fragment, apply it, and keep the change small enough to understand.

Where a path should be removed from the index rather than from the crawl, the correct instrument is a noindex directive on the page itself, or an X-Robots-Tag header. That is the subject of noindex vs robots.txt, and it is a different mechanism with a different failure mode.

Where to do next​

Open your robots.txt, count the lines, and check how many of them point at paths that still exist. Most large sites find that a meaningful share of their blocking is doing nothing at all, because the URLs it covers were never indexed in the first place. That is a good outcome, and it means you can remove the line without a migration. For the rest, the honest sequence is to identify what you actually want, then choose the instrument that produces it: a block for areas that should not be crawled, a noindex for pages that should be crawled but not indexed, and a 410 for pages that should stop existing. The User Guide explains how those changes are assembled and handed over.