Metricum Lab

Crawling & indexing

Robots.txt vs. Noindex: How to Keep URLs Out of Google Search

A robots.txt rule can stop Googlebot from crawling a URL, but it does not reliably keep that URL out of Search. If the page itself should not appear in Google, let Google crawl it and provide a noindex directive. Use password protection for private content.

Yurii Pekach PublishedUpdated8 min read
robots.txt restricts crawling, but the URL may remain in Search. A readable noindex directive excludes the page from the index.

The short answer

Use noindex when a public page should be excluded from Google Search, and keep the page crawlable so Google can read the directive. Use robots.txt when your goal is to manage crawler access. Use authentication for private information. Search Console can help you check what Google has indexed and what it can see now, but neither a test nor a request guarantees an immediate search-result change.

Access

robots.txt

Controls which URLs a crawler is allowed to request; it is not a reliable page-removal method.

Privacy

Access control

Password protection restricts access; search directives do not secure content.

Two controls, two different jobs

The choice is not simply between two ways to hide a URL. robots.txt controls crawling: it tells compliant crawlers which URLs they may request. noindex is an indexing instruction: when Google can crawl and process the page, the directive tells it not to include that page in Google Search. Google describes robots.txt as a way to manage crawler traffic, not as a mechanism for keeping a web page out of Search.

Custom diagram

Choose the control by the outcome you need

A decision flow distinguishes privacy, temporary hiding, search exclusion, and crawl management.

  1. Must this content be private?

    Yes → require authentication or password protection.

  2. Need a temporary hide?

    Use Search Console Removals while you address the underlying page.

  3. Should a public page stay out of Search?

    Use noindex and allow Google to crawl the page.

  4. Managing crawler access?

    Use robots.txt for crawl management, not guaranteed removal.

  5. Verify

    Compare URL Inspection's indexed data with its live test.

The control depends on whether you need access protection, a temporary hide, search exclusion, or crawler-access management.
What each control is meant to do
ControlPrimary purposeWhat it does not guarantee
robots.txtManage crawler access to URLs.That a URL cannot appear in Search.
noindexTell Google not to index a page it can process.A particular removal time or search-result schedule.
Password protectionRestrict access to private content.A specific search outcome for previously discovered URLs.
Search Console RemovalsRequest a temporary hide from Search.Permanent exclusion by itself.

Why a robots.txt block may leave a URL in Search

Google can discover a URL from links on other pages even when robots.txt disallows crawling it. If Google cannot fetch the page, it cannot read the page's content or its noindex directive. The URL may still be indexed without its page content and can appear in results without a description. This is a possibility, not an outcome for every blocked URL.

Custom diagram

How a blocked URL can still be discovered

An external or internal link can reveal a URL while a robots.txt rule prevents Googlebot from fetching its page.

  1. A link points to the URL

    Google may discover the address from another crawlable page.

  2. robots.txt disallows the URL

    Googlebot skips the request to that URL.

  3. Page content is unavailable to Google

    The blocked page's content and page-level directives cannot be read in that request.

  4. URL may still appear

    The URL can be indexed without its page content.

Discovery of a URL and access to its contents are separate. A crawl block can withhold the content without guaranteeing that the URL stays out of Search.

Choose the control that matches your goal

Start by naming the outcome, not the directive. A page intended for users but not for search generally calls for noindex. A URL that should not be fetched for crawl-management reasons may call for robots.txt. Content that must remain confidential needs an access restriction. These goals are different, and one mechanism should not be expected to perform all three.

Route the URL to the right control

  1. 1

    Is the content private?

    Put authentication or password protection in front of it. Do not rely on robots.txt or noindex as security controls.

    Pass criterionAn unauthenticated visitor and crawler cannot retrieve the protected content.

  2. 2

    Is the hide temporary?

    Use the Search Console Removals tool for a temporary hide, and separately decide what lasting page change is appropriate.

    Pass criterionThe removal request is treated as temporary; the underlying access or indexing state is addressed separately.

  3. 3

    Should a public page be excluded from Google Search?

    Provide noindex in the page metadata or an appropriate response header, and leave the URL crawlable so Google can read it.

    Pass criterionA live inspection can fetch the page and identify the noindex instruction.

  4. 4

    Is the actual goal crawl management?

    Use robots.txt to control crawler access to the relevant URL pattern. Do not interpret that rule as a guarantee that its URLs cannot appear in Search.

    Pass criterionThe crawl rule matches the intended URLs and does not block pages whose directives Google needs to read.

Match the need to the mechanism
Your goalStarting pointImportant check
Exclude a public page from Google SearchnoindexGooglebot can crawl and read the directive.
Reduce crawler access to a URL patternrobots.txtThe rule does not block pages that need to be crawled for another instruction.
Keep content confidentialAuthentication or password protectionThe content is not publicly retrievable.
Hide a result temporarilySearch Console RemovalsA successful request lasts about six months; it is not permanent control.

Apply noindex without hiding it from Google

For an HTML page, a robots meta tag can carry the noindex instruction. Google also documents a robots meta example for JavaScript-powered pages. Whichever implementation you use, the key operational check is that Google can fetch the page and encounter the directive. If your site uses a CMS, look for its search-visibility setting or documentation; you may not need direct access to the HTML or robots.txt file.

Example robots meta tag

<head>
  <meta name="robots" content="noindex">
</head>

Illustrative HTML for a page-level directive; not tested in a particular CMS or deployment. Confirm that the rendered page includes the tag and that robots.txt does not disallow the URL.

When neither control is the right fix

Three neighboring problems are easy to confuse with page exclusion. Privacy requires access control. A fast, temporary hide is what Search Console Removals is for; Google says a successful request lasts about six months. Duplicate URLs are a canonicalization problem: Google advises against using robots.txt for canonicalization and says noindex is not the preferred way to select a canonical page among duplicates. Use redirects, rel="canonical", or other appropriate canonical signals for that separate task.

Custom diagram

Keep adjacent problems separate

Privacy, temporary search-result hiding, duplicate consolidation, and lasting page exclusion lead to different controls.

  1. Private content

    Restrict access with authentication.

  2. Temporary search-result hide

    Use Search Console Removals; plan a lasting solution separately.

  3. Duplicate or similar URLs

    Choose an appropriate canonicalization method.

  4. Page should not be indexed

    Use a crawlable page with noindex.

A control that addresses one URL problem may be unsuitable for another.

Check what Google can see and what it has indexed

In Google Search Console, open the correct property and enter the complete URL in the URL Inspection bar. Read the indexed information and the live test as two different views: the indexed report describes Google's most recently stored version, while Test live URL checks the page as it can be fetched now. A live test can help identify whether the current page is accessible and whether it might be indexable; it does not prove what is currently in the index or predict canonical selection.

Inspect the indexed state, then the live page

  1. 1

    Inspect the indexed URL

    In Search Console, enter the full URL in the top URL Inspection field. Review the reported indexing status and, when available, the indexed page's robots information and Google-selected canonical.

    Pass criterionYou have recorded what Google reports for its stored version, rather than treating the report as a live fetch.

  2. 2

    Run Test live URL

    Use the live test to check the page as it is currently accessible to Google. If you expect noindex, check that the URL is not blocked from crawling and that the directive is present in the fetched or rendered page.

    Pass criterionThe live test can fetch the page and the result is consistent with the directive you intended to publish.

  3. 3

    Request indexing only when appropriate

    If you have corrected the page and want Google to recrawl it, you can request indexing in URL Inspection. Do not treat the request as a command to index or remove the URL.

    Pass criterionYou have a request recorded, but continue monitoring for Google's processed state rather than assuming an immediate change.

If the indexed report still shows the old state while the live test shows the corrected page, Google may not yet have recrawled and reprocessed the change. If the live test cannot access the page, investigate the response, access controls, and robots.txt before relying on a page-level noindex. Google does not guarantee that it will crawl, index, or serve a page, and a request does not guarantee instant inclusion or removal.

A practical URL-by-URL checklist

For each affected URL, write down the required outcome before changing a directive. That small distinction prevents the most common mistake: blocking a page that needs to remain crawlable for Google to see its noindex instruction.

  • Need confidentiality? Require authentication or password protection.
  • Need only a temporary search-result hide? Use Search Console Removals and plan the lasting page change separately.
  • Need a public page excluded from Google Search? Use noindex and leave the URL crawlable.
  • Need to manage crawler access? Use robots.txt, understanding that a blocked URL may still appear in Search.
  • Dealing with duplicate URLs? Choose an appropriate canonicalization method instead of using robots.txt or noindex as a substitute.
  • After a change, compare the indexed report with Test live URL in Search Console. Monitor the result; do not assume a request changes Search instantly.

Primary sources and documentation

Sources

Every changing search, browser, interface or technical-behavior claim in this guide is tied to a current primary source.

  1. Google Search Central Robots.txt Introduction and Guide (opens in a new tab)
  2. Google Search Central Understand JavaScript SEO Basics (opens in a new tab)
  3. Google Search Console Help URL Inspection tool (opens in a new tab)
  4. Google Search Central Get started with Search Console (opens in a new tab)
  5. Google Search Central How to Specify a Canonical with rel="canonical" and Other Methods (opens in a new tab)
  6. Google Search Central In-Depth Guide to How Google Search Works (opens in a new tab)
  7. Google Search Central Ask Google to Recrawl Your Website (opens in a new tab)
  8. Google Search Central Influencing Title Links in Google Search (opens in a new tab)
  9. Google Search Central Control your snippets in search results (opens in a new tab)

Need help diagnosing and implementing the fix?

Need to resolve a crawl or indexing issue?

Get help diagnosing URL access, directives, and the signals affecting how Google processes your site.

Discuss crawl and indexation