Robots.txt and the noindex directive get treated as interchangeable, and they are not. One controls whether a crawler fetches a URL. The other controls whether a fetched URL appears in search results. Use the wrong one, or stack both on the same URL, and you end up with pages that stay indexed when you wanted them gone, or pages that cannot be fixed because Google never sees your instructions.
This post explains what each control does, where they collide, and how we audit them on a real site.
What each control actually does
Robots.txt controls crawling
The robots.txt file sits at the root of a host (for example, example.com/robots.txt) and tells crawlers which paths they may request. It applies per host and per protocol, so a subdomain needs its own file. Google supports the * wildcard and the $ end-of-URL marker, which is how most real-world rules are written.
A disallow rule does not remove a URL from the index. If other pages link to a blocked URL, Google can still index the bare address with no description, because it knows the URL exists but cannot read the page.
Noindex controls indexing
Noindex is a directive delivered in a meta robots tag or an X-Robots-Tag HTTP header. The header version is the practical option for PDFs and other non-HTML files. Google has to crawl the page to see the directive, and once it does, it drops the page from results.
Canonical is a third, weaker signal
A rel=canonical tag is a hint about which version of similar content you prefer. It is not a blocking tool. We mention it here because audits often find canonicals, noindex and robots rules all applied to the same URL, each pulling in a different direction.
The conflict that causes most problems
The classic mistake is adding a noindex tag to a page and also disallowing that page in robots.txt. Google cannot crawl the page, so it never reads the noindex tag. If the URL was already indexed, or has external links pointing at it, it can linger in results indefinitely.
The same trap appears in other forms:
- A staging or old section is disallowed, then someone adds noindex later to clean up, and nothing changes.
- A faceted or parameter path is blocked in robots.txt, but the canonical tags on those pages are never seen, so link signals cannot consolidate.
- A site migration leaves a blanket disallow in place from the development environment, and new pages never get crawled at all.
Also remember that Google stopped honoring a noindex rule written inside robots.txt in 2019. If an old file still contains one, it does nothing.
How to audit crawl and index controls
We run this in a fixed order so each step informs the next.
- Read the live robots.txt file. Check every host you own, including subdomains and the www and non-www versions. Look for broad rules like Disallow: /, rules that match more than intended because of a missing slash or wildcard, and leftover rules for paths that no longer exist.
- Crawl the site and record the indexability state of each URL. For every page you want the status code, meta robots value, X-Robots-Tag value, canonical target and whether robots.txt blocked the fetch. A page-by-page crawl that reports all of these in one table makes the next steps much faster. This is the kind of check we built the site audit in SearchAuditPro to handle, since it surfaces blocked, noindexed and canonicalized URLs side by side.
- Find URLs that are both blocked and noindexed. These are the conflicts. Decide for each one whether the goal is removal from search or simply saving crawl effort, then fix accordingly (see the next section).
- Find important pages that are blocked or noindexed by accident. Cross-check against your list of revenue pages, key category pages and top organic landing pages. Template-level noindex tags are a frequent culprit, since one setting can affect hundreds of URLs.
- Check the other direction. Look for thin, duplicate or private URLs that are indexable and should not be. Internal search results, cart and account pages, and test pages are the usual suspects.
- Compare against Google Search Console. The page indexing report tells you which URLs Google reports as blocked by robots.txt, excluded by noindex, or indexed despite being blocked. Differences between your crawl and that report point to caching delays or rules your crawler did not interpret the same way.
Choosing the right control for each situation
Start from the outcome you want, not the tool you know best.
- You want the page out of search results. Use noindex and leave the page crawlable. Wait until Google has recrawled and dropped it, and only then consider a robots.txt block, if you need one at all.
- You want to save crawl effort on low-value URL patterns. Use robots.txt, but only for URLs that are not already indexed and do not need to pass signals. Endless parameter combinations and internal search paths are typical examples.
- The content is private. Neither control is appropriate. Use authentication. Robots.txt is public and openly lists the paths you are trying to hide, and noindex only asks politely.
- You have duplicate versions and want signals combined. Use canonical tags or redirects, and keep the duplicates crawlable so Google can see them.
- A non-HTML file should not be indexed. Use the X-Robots-Tag header, since there is no HTML head to hold a meta tag.
- A page is gone for good. Return a 404 or 410, or redirect it to a close equivalent. Do not noindex pages that should simply not exist.
Mistakes we see repeatedly
Blocking CSS and JavaScript
If robots.txt blocks resources needed to render a page, Google may see a broken or empty version of it. Check that the files your templates depend on are fetchable.
Treating the removals tool as permanent
The Search Console removals tool hides URLs temporarily. It is useful for urgent cases, but the lasting fix is still a noindex, a 404 or 410, or authentication.
Forgetting the file is case and path sensitive
Rules match paths exactly as written, and URL paths are case sensitive. A rule for /Blog/ will not cover /blog/. Test sample URLs against the file rather than assuming a rule works.
Leaving noindex in place after launch
Many sites ship with a sitewide noindex on staging and carry it into production, or the reverse. Make a launch check that reads both the robots.txt file and the meta robots tag on a handful of key templates.
Using nofollow as a blocking tool
Nofollow on links is a hint about how to treat a link. It does not stop crawling or indexing of the target, especially if other links point to it.
Verifying changes after you make them
Fixing the rules is half the job. Confirm the result:
- Fetch the live robots.txt and make sure the deployed version matches what you intended.
- Use the URL Inspection tool in Search Console on a few representative URLs to see how Google reads their crawl and index status.
- Recrawl the affected sections and confirm that blocked, noindexed and canonical signals now agree with each other for every URL.
- Watch the page indexing report over the following weeks. Noindexed pages drop out as Google recrawls them, which can take longer for rarely visited URLs.
- Keep a dated record of changes to robots.txt and templates. When traffic moves unexpectedly, a change log saves hours of guesswork.
A simple rule to remember
If you want Google to do something with a page, such as drop it, consolidate it or follow a redirect, Google has to be able to crawl it. Robots.txt is for managing crawl effort. Noindex, canonical tags and redirects are for managing what ends up in the index. Keeping those jobs separate, and auditing them together on a regular schedule, prevents most of the indexing surprises we get asked about.
