SEO & Search Marketing

Robots.txt vs Noindex: Which Should You Use to Keep Pages Out of Google?

You have pages you do not want in Google: internal search results, thank-you pages, thin tag archives, staging copies, filtered product lists. The two tools most people reach for are a rule in…

You have pages you do not want in Google: internal search results, thank-you pages, thin tag archives, staging copies, filtered product lists. The two tools most people reach for are a Disallow rule in robots.txt and a noindex meta tag. They sound interchangeable. They are not. In fact, using them together on the same page is one of the most common reasons unwanted pages stay in search results.

This article explains what each one does, why they work differently, when to use which, and how to remove pages from Google properly.

The Short Answer

  • Robots.txt controls crawling: whether search engines may request a URL.
  • Noindex controls indexing: whether a page may appear in search results.

If you want a page out of Google's results, use noindex and make sure the page is crawlable.

If you want search engines to stop spending crawl resources on a set of URLs and you do not mind if a few appear in results without a description, use robots.txt.

How Robots.txt Works

Robots.txt is a file at the root of your domain listing rules for crawlers:

User-agent: *
Disallow: /search/

This tells compliant crawlers not to request any URL beginning with /search/.

What it does not do is tell search engines to forget those URLs. If other pages link to a blocked URL, Google can still index the URL itself, based on the links and anchor text pointing to it. It usually appears in results without a description, with a note that no information is available for the page.

Robots.txt is best thought of as a crawl management tool, not an indexing tool.

How Noindex Works

Noindex is a directive that tells search engines not to include a page in their index. It can be set in two ways:

As a meta tag in the HTML head:

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

As an HTTP response header, which also works for PDFs and other non-HTML files:

X-Robots-Tag: noindex

When Google crawls a page and finds noindex, it drops the page from search results, even if other sites link to it.

The crucial detail: Google has to crawl the page to see the noindex. If the page is blocked by robots.txt, Google never fetches it, never sees the noindex, and may keep the URL in its index.

Tip: Never block a page in robots.txt and add noindex at the same time. The robots.txt block hides the noindex from Google, so the page can stay in results indefinitely.

Why Combining Them Backfires

This is the classic mistake:

  1. A site has thousands of thin tag pages in Google
  2. The team adds noindex to them
  3. To "help", they also add Disallow: /tag/ to robots.txt
  4. Google stops crawling the tag pages, so it never sees the noindex
  5. The tag pages stay in the index, now without descriptions

The fix is to remove the robots.txt block, let Google recrawl the pages and see the noindex, wait for them to drop out of the index, and only then, if you want to save crawl resources, consider blocking them again.

When to Use Robots.txt

Use robots.txt when the goal is to stop crawling, typically on large sites where crawl resources matter:

  • Infinite or near-infinite URL spaces: calendar pages, faceted navigation with endless combinations, sorting parameters
  • Internal search results, especially when they generate unlimited URLs
  • Resource-heavy URLs that strain your server
  • Admin and system paths that have no reason to be crawled
  • Duplicate parameter URLs you have already handled with canonicals and do not want crawled at all
  • AI crawlers you choose not to allow

Robots.txt is also the right tool for blocking specific crawlers by name.

When to Use Noindex

Use noindex when the goal is to keep a page out of search results:

  • Thank-you and confirmation pages
  • Thin tag, author or archive pages
  • Internal search results pages that are already indexed and need removing
  • Login and account pages
  • Duplicate or near-duplicate pages you cannot consolidate
  • Staging pages on a public URL, as a backup to password protection
  • Paginated or filtered pages you do not want indexed, while still letting crawlers follow their links

Noindex pages can still be crawled and their links can still be followed, so they continue to pass discovery to the pages they link to.

When to Use Neither

Sometimes neither tool is the best answer.

Duplicate content: use canonical tags

If several URLs show the same content, such as a product reachable through several category paths, a canonical tag pointing at the preferred URL consolidates signals. Noindex would discard the duplicates' signals instead.

Deleted content: return 404 or 410

If a page no longer exists and has no replacement, let it return 404 or 410. Google drops it from the index after recrawling.

Moved content: use a 301 redirect

If a page has a new home, redirect it. Noindex or robots.txt would lose its rankings and links.

Private content: use authentication

Anything that must never be public, such as customer data, internal documents or staging sites, belongs behind a password. Robots.txt is public, voluntary and even advertises the paths you want hidden.

Decision Table

GoalBest tool
Keep a page out of search resultsNoindex (page must be crawlable)
Stop crawlers wasting resources on infinite URLsRobots.txt
Consolidate duplicate URLsCanonical tag
Remove a deleted page404 or 410
Move a page301 redirect
Keep content privateAuthentication
Block a specific crawlerRobots.txt group for that user agent
Remove a URL from results urgentlySearch Console Removals tool, plus noindex or deletion

How to Remove Pages From Google Properly

If unwanted pages are already indexed:

  1. Make sure they are crawlable. Remove any robots.txt rule that blocks them. Test the URLs to confirm.
  2. Add noindex with a meta tag or X-Robots-Tag header.
  3. Let Google recrawl. You can speed this up by including the URLs in a temporary sitemap or by requesting indexing for important ones in URL Inspection.
  4. Use the Removals tool for urgency. Search Console's Removals tool hides URLs from results for about six months, giving the noindex time to take effect.
  5. Confirm they have dropped out. Check the Page indexing report for "Excluded by noindex tag".
  6. Then, optionally, block crawling. Once the pages are gone from the index, a robots.txt rule can stop future crawling if it saves meaningful crawl resources.

Google's documentation on blocking indexing with noindex confirms that noindex only works if the page is not blocked by robots.txt.

Common Scenarios, Answered

Staging site

Use password protection. If the staging site is already indexed, add noindex and keep it crawlable until it drops out, then protect it. Do not rely on robots.txt alone.

Thank-you page after a form

Noindex. It has no search value and should not appear in results, but there is no crawl problem to solve with robots.txt.

Internal site search results

If they are not indexed, a robots.txt block is fine and saves crawl. If they already are, noindex first, wait for removal, then block.

Faceted navigation on a large shop

Decide which filter combinations deserve indexable pages. For the rest, prevent crawling with robots.txt patterns and avoid linking to them, or use canonicals to the unfiltered category if you prefer to keep them crawlable.

Add an X-Robots-Tag: noindex header for those files. A robots.txt block would leave them indexable from links.

Old campaign landing pages

If they have links or traffic, redirect them to a relevant live page. If not, let them return 404 or 410.

Tag and author archives on a blog

If they add little value, noindex them, and keep them crawlable so their links to posts still help discovery.

Admin and login areas

Robots.txt disallow is fine for crawl efficiency, but security depends on authentication, not robots.txt.

Testing Before You Change Anything

Because robots.txt affects the whole site and noindex depends on crawl access, test both:

  • Robots.txt: paste your file and a list of URLs into a robots.txt tester to see which URLs each crawler can fetch and which rule decides it. Confirm that every page you want noindexed is allowed.
  • Noindex: check the page source or response headers, or use an indexability checker, to confirm the directive is present and nothing contradicts it, such as a canonical pointing elsewhere.

Example: Cleaning Up Internal Search Pages

Imagine an online shop with 40,000 internal search result URLs in Google's index, all thin and duplicative. They were indexed because the site linked to popular searches from its footer. The shop had added Disallow: /search to robots.txt a year earlier, but the pages stayed in results.

The team:

  1. Removes the robots.txt rule and confirms with a tester that /search URLs are now crawlable
  2. Adds noindex to the search results template
  3. Removes the footer links to popular searches
  4. Waits as Google recrawls the pages

Over the next two months, the indexed search pages drop steadily. Once almost all are gone, the team restores the robots.txt rule to stop crawlers spending resources on search URLs in future.

Common Mistakes

  • Using robots.txt to deindex pages. It does not remove them.
  • Combining robots.txt blocks with noindex. The block hides the noindex.
  • Noindexing pages that should be canonicalised. You lose their signals.
  • Noindexing pages that should be redirected. You lose their rankings and links.
  • Relying on robots.txt for privacy. It is public and voluntary.
  • Using Noindex: inside robots.txt. Google does not support it.

Frequently Asked Questions

Can I use noindex in robots.txt?

No. Google stopped supporting noindex rules in robots.txt in 2019. Use a meta robots tag or an X-Robots-Tag header.

How long does noindex take to work?

Pages drop out after Google recrawls them, which can take days for popular pages and weeks or months for rarely crawled ones.

Google crawls noindexed pages and can follow their links, so they still help with discovery. Over long periods, Google may crawl long-term noindexed pages less often.

Should I noindex pagination?

Usually not. Paginated pages help search engines discover products and articles. Let them be indexed with self-referencing canonicals.

What if a blocked page shows in results?

Remove the robots.txt block, add noindex, and let Google recrawl it.


Robots.txt manages crawling. Noindex manages indexing. Mixing them up keeps the wrong pages in Google. Before your next change, test your rules with the free Robots.txt Tester and make sure every page you want removed is one Google can actually reach.