Technical AEO
Robots.txt vs Noindex: Choose the Control That Matches the Goal
This guide is part of the King of AEO learning library.
The short answer
Robots.txt asks compliant crawlers which paths they may request. Noindex tells supported search engines not to include a resource in their index after they retrieve the instruction. These controls solve different problems: blocking crawling can prevent discovery of noindex. For confidential information, use authentication or other real access controls. Choose the desired outcome first, then verify the live implementation.
In this guide
Translate “hide this page” into a precise outcomeUse robots.txt for deliberate crawl policyUse noindex when the public resource should be excludedAvoid the combination that prevents discovery of the directiveKeep environment controls from leaking into productionApply the rule in the correct placeSourcesTranslate “hide this page” into a precise outcome
“Hide” can mean stop automated requests, remove a public page from search results, keep a draft private or retire an obsolete resource. Those outcomes require different controls. Ask what should remain possible for an ordinary visitor and for a crawler. A publicly accessible thank-you page may be useful to visitors but unsuitable as a search result. A private customer report should reject unauthorised access altogether. Treating both as the same publishing setting creates avoidable confusion.
Robots.txt addresses crawler requests to specified paths. Noindex addresses inclusion by search engines that support the instruction. Authentication addresses whether a requester is allowed to receive the resource. These are separate layers of behaviour. The Robots Exclusion Protocol states that its rules are not an access-authorisation mechanism. That is the crucial boundary: a request not to crawl cannot protect content from a visitor or client that is otherwise able to retrieve it.
Write the intended state for representative URLs before editing configuration. For an illustrative site, public articles should be discoverable, a confirmation page should remain usable after a form submission, and an editorial preview should require sign-in. The examples make the policy concrete and help reviewers spot a broad rule that accidentally affects the wrong group. AI crawler controls adds the separate question of which provider agent and purpose a rule is meant to address.
Use robots.txt for deliberate crawl policy
A robots file can express path restrictions for compliant agents. Its usefulness depends on the relevant crawler’s documented handling and the file actually served by the host. Do not assume a rule in a repository is the rule reaching requesters. Fetch the live file and test the specific paths involved. When a policy has been copied through several deployments, the comments may describe an old intention that no longer matches the current public site.
Google’s robots introduction explains that a blocked URL can still appear in search using information discovered elsewhere. Therefore a robots block is not a reliable instruction to remove a public webpage from Google’s results. This distinction matters when someone sees a URL listed without the expected page content and concludes that the block failed. The crawler may have respected the request while the engine still knows that the address exists.
Choose narrow rules when the purpose is narrow. A restriction intended for an internal search-results route should not accidentally cover the article library because of an overbroad path pattern. Preserve a short rationale for each important rule and identify who owns it. The crawlability guide covers diagnosing unintended restrictions. The policy decision and the access test belong together: you need to know both what should be blocked and what the live system actually prevents.
Desired outcome: What should remain possible?
Limit requests: Use documented robots policy
Exclude public page: Keep crawl access for noindex
Protect information: Require authorisation
Verify live response: Test the intended resource
Crawl restriction, search exclusion and private access are separate goals that need different controls.
Use noindex when the public resource should be excluded
Noindex is delivered with the resource, commonly through HTML metadata or an HTTP response header. Google’s noindex documentation describes both methods and the need for crawler access. The appropriate delivery method depends on the resource and serving system. An HTML page can carry a metadata tag, while a downloadable file may need a response header. The instruction must be present in what the crawler actually receives, not merely in an unrelated page linking to the file.
Inspect the response rather than relying only on a content-management checkbox. A hosting layer can add a header, and a page template can add metadata independently. If an article is unexpectedly excluded, examine both. Removing one visible setting may leave another active instruction in place. The indexability guide covers the wider diagnosis. For this control choice, the key question is whether the intended public resource communicates the desired indexing instruction consistently through its live response.
Do not add noindex merely because two public URLs show equivalent content. If the real objective is to identify a preferred representative, use the canonical URL guide. Exclusion and duplicate selection are different statements. Similarly, an obsolete article with a genuine replacement may need a redirect rather than a page that remains accessible but excluded. Choose the control that describes the actual relationship, so future maintainers can understand why it exists.
Avoid the combination that prevents discovery of the directive
The common failure is to block a page in robots.txt while relying on that same page’s noindex instruction for search removal. A compliant crawler cannot inspect a resource it is prevented from requesting. The stronger-looking combination can therefore stop the desired exclusion instruction from being discovered. Draw the dependency explicitly: the crawler must request the page, receive the response and read the directive before it can act on that directive. The order explains the problem more clearly than a list of settings.
For an illustrative public confirmation page, the intended outcome may be that visitors can use the page while it does not appear as a search entry point. A crawlable page carrying noindex expresses that goal more directly than a robots block. If the page contains sensitive information, however, making it crawlable for the directive is the wrong security strategy. Protect the information with access control. The requirement to keep data private takes precedence over a technique for managing a public search listing.
Changing a directive is not the same as proving that a service has processed it. Record when the live response changed and compare that with available crawl or inspection evidence. A previously indexed URL may not disappear at the moment you save a setting. Avoid rewriting the configuration repeatedly because an old result is still visible. First determine whether the relevant engine has fetched the updated resource and whether the response actually contains the intended instruction.
Keep environment controls from leaking into production
Preview environments often need authentication and may also carry indexing exclusions as a secondary publishing precaution. Production articles usually need different treatment. Make the environment distinction explicit in deployment configuration, and test the resulting public response after launch. A single inherited default can affect every page using a shared template. The homepage alone is an insufficient sample if articles and downloads receive different headers or render through separate routes.
Include a public article, an intentionally excluded page and a private route in a targeted release check. The article should retain its intended access, the excluded public page should express its indexing preference, and the private route should reject unauthorised retrieval. Technical release checks can preserve these expectations over time. This three-way test is more informative than checking only that the page you wanted to hide no longer appears in one manual search.
Finally, keep provider-specific purposes separate from general control semantics. A named AI agent might support search discovery, model development or user-directed fetching, and each provider documents its own handling. Do not infer those purposes from the general words “bot” or “AI”. Record the chosen agent, path and outcome beside the rule. A well-designed policy lets the next maintainer answer three questions quickly: what access is intended, what indexing behaviour is requested and which information must remain protected regardless of crawler cooperation.
Apply the rule in the correct place
For an ordinary HTML page that should remain accessible but stay out of search results, put the following meta element in its document head. Keep the URL available to the crawler so it can read the directive. This example concerns a public search-results page; it is not a security measure for confidential records. A private document instead needs authentication and appropriate access controls.
For a PDF or another non-HTML resource, configure an HTTP response header such as X-Robots-Tag: noindex. Check the actual response after deploying. If a robots.txt disallow prevents the crawler from requesting that URL, the crawler cannot discover the noindex header there. Test one representative restricted page and one intended public article so that a template-level change cannot quietly exclude the whole library.
<meta name="robots" content="noindex, follow">Sources and further reading
- Robots Exclusion ProtocolRobots rules are crawler instructions, not access authorisation.
- Google robots.txt introductionRobots.txt manages crawler requests and does not reliably remove URLs from search.
- Google noindex documentationGoogle must crawl a resource to discover its noindex directive.