Use robots.txt to manage crawler access, noindex to keep an accessible URL out of search results, X-Robots-Tag for response-level or non-HTML control, and authentication for private content.
- Robots.txt controls crawling, not dependable removal from search results.
- Google must crawl a URL before it can observe noindex in HTML or an HTTP header.
- X-Robots-Tag is the practical indexing control for PDFs and other non-HTML resources.
- Private content belongs behind authentication rather than crawler directives.
01
Definition
robots.txt, a robots meta rule, and the X-Robots-Tag response header solve different problems. Treating them as interchangeable is one of the easiest ways to create a URL that is blocked from crawling yet still appears in search results with little or no page information.
A robots.txt rule controls whether a crawler may request a URL. It is mainly a crawl-management tool, not a reliable page-removal tool. Google states that a disallowed web-page URL can still be discovered and indexed from links even when Google cannot fetch the page content. Introduction to robots.txt[1]
A noindex rule controls whether an accessible page or resource may remain in Google Search. Google must crawl the URL and read the rule before it can act on it. The rule can be supplied in an HTML robots meta element or through an HTTP X-Robots-Tag header. Block Search indexing with noindex[2]
The practical distinction is:
- Use
robots.txtto manage crawler access. - Use
noindexto keep an accessible URL out of search results. - Use
X-Robots-Tagwhen the resource is not ordinary HTML or when response-level control is easier. - Use authentication when the content is private.
- Remove the resource or return a genuine not-found response when it should no longer exist.
This is a control-selection problem, not a contest to see how many directives can be stacked onto one URL.
02
Mechanism
A crawler must be allowed to fetch a page before it can observe page-level indexing rules. Google explicitly warns that a noindex rule is ineffective when the same URL is blocked by robots.txt, because Googlebot cannot retrieve the page and see the rule. Block Search indexing with noindex[2]
That creates a predictable sequence for removing an indexed HTML page:
- Allow Googlebot to crawl the URL.
- Return the page with a valid
noindexrule, or remove the page and return an appropriate status. - Let Google recrawl and process the change.
- Use the Search Console Removals tool only when a faster temporary blackout is needed.
- After the URL has left the index, decide whether continued crawling should remain allowed.
For HTML, a robots meta rule is often the simplest implementation. For PDFs, images, video files, generated documents, and other non-HTML resources, use an X-Robots-Tag response header. Google documents that any rule available in the robots meta system can also be delivered through the header. Robots meta tag and X-Robots-Tag specifications[3]
A response can conceptually include:
HTTP status: 200 OK
Content-Type: application/pdf
X-Robots-Tag: noindexThe resource stays publicly accessible, but Google can process the response-level instruction after crawling it.
Indexing and serving controls can also affect snippets, image previews, translations, and expiration. Google applies the more restrictive rule when supported directives conflict. That makes duplicate rule ownership risky: a CMS, reverse proxy, application framework, and CDN can each emit a different header or tag while every team assumes somebody else owns the final result.
Private content requires a stronger boundary. robots.txt is publicly readable and voluntary. A URL disallowed from crawling is still reachable by anyone who knows the address. Google recommends password protection when content must not be accessible to anonymous users. Control the content you share on Search[4]
03
Examples
A staging environment
A staging site contains unreleased pricing, internal comments, and test accounts. The correct control is authentication or network access control. A sitewide Disallow rule may reduce compliant crawler access, but it does not make the host private and can reveal interesting paths in a public file. Adding noindex is useful only after an authorized crawler can access the page, which is usually unnecessary for a properly protected staging host.
A public PDF that should not appear in search
The document must remain downloadable from a customer portal page, but it should not appear independently in Google Search. Return an X-Robots-Tag: noindex header on the PDF response. Do not block the PDF in robots.txt, because Google needs to fetch the response to observe the header.
An internal search-results page
The page is public and users need it, but it should not become a large index of thin parameter combinations. A page-level noindex rule can keep the result pages out of search while preserving access. If crawling volume becomes a serious problem on a very large site, use URL-inventory controls and carefully designed robots.txt patterns only after confirming that Google has processed the indexing state you want.
A removed press release
If the content should no longer exist, return a genuine 404 or 410 response rather than serving a soft error page with 200 OK. A temporary Search Console removal may hide it quickly while Google processes the permanent origin change. Blocking the URL in robots.txt before Google sees the removal can delay understanding.
A page with two conflicting owners
The application emits index, an SEO plugin emits noindex, and the CDN adds X-Robots-Tag: noindex. Google will apply the restrictive supported rule. Debug the final rendered HTML and actual HTTP response, not the settings screens that supposedly generated them.
04
Boundaries
None of these controls is a security system. A robots directive asks compliant crawlers how to handle content; it does not revoke public access, encrypt a file, or prevent copying. Confidential information belongs behind authentication and authorization.
Do not use robots.txt to solve every indexing problem. It can reduce crawler access, but a blocked URL may still be indexed from external or internal references. Do not use noindex while simultaneously preventing Googlebot from reading it. Do not use a canonical tag as a substitute for removal when the duplicate should never appear. Canonicals are consolidation signals, not access controls.
Audit the final URL through this sequence:
- Request the exact production URL without cookies.
- Record the status, redirects, headers, and rendered indexing rules.
- Test whether
robots.txtpermits Googlebot access. - Confirm whether the resource is HTML or non-HTML.
- Inspect the live URL in Search Console.
- Compare the live response with Google’s indexed state.
- Check for duplicate rules from plugins, proxies, and CDNs.
- Verify that private content is actually protected.
- Monitor the Page Indexing report after recrawling.
Use Search Console Removals Tool when speed matters after the permanent control is chosen. Use Googlebot Crawl Delay when the underlying issue is request volume rather than index visibility. The correct rule is the one that matches the intended state: inaccessible, uncrawled, unindexed, or simply displayed with fewer search features.
References
Sources behind this record
- Introduction to robots.txt — Google (accessed August 1, 2026)
- Block Search indexing with noindex — Google (accessed August 1, 2026)
- Robots meta tag, data-nosnippet, and X-Robots-Tag specifications — Google (accessed August 1, 2026)
Corrections
Correction history
No corrections recorded.
To report an error, use the public corrections path.
Crawler and indexing directives do not provide confidentiality, revoke public access, or guarantee immediate processing.