---
title: "robots.txt vs. noindex"
description: "robots.txt tells crawlers which URLs not to fetch, but it doesn't reliably keep pages out of search results. noindex tells search engines not to list a page, but they must be able to crawl the page to see it. Use robots.txt to control crawling and noindex to control indexing."
url: "https://glossary.io/compare/robots-txt-vs-noindex/"
published: "2026-11-23T19:39:14.914Z"
updated: "2026-11-23T19:39:14.914Z"
terms:
  - "https://glossary.io/robots-txt/"
  - "https://glossary.io/noindex/"
---

# robots.txt vs. noindex

**The short answer:** robots.txt tells crawlers which URLs not to fetch, but it doesn't reliably keep pages out of search results. noindex tells search engines not to list a page, but they must be able to crawl the page to see it. Use robots.txt to control crawling and noindex to control indexing.

robots.txt and noindex are both ways for site owners to give instructions to search engines, and they are often confused because both seem to hide pages. They work at different stages. robots.txt is a single file that controls which URLs crawlers may request, while noindex is a directive on an individual page or file that controls whether it may appear in search results. Choosing the wrong one, or combining them incorrectly, can leave unwanted pages in results or remove pages you wanted found.

## robots.txt vs. noindex at a glance

|  | robots.txt | noindex |
| --- | --- | --- |
| What it controls | Crawling: which URLs crawlers may request | Indexing: whether a page may appear in search results |
| Where it is set | One plain-text file at the root of each host, at /robots.txt | A robots meta tag in the HTML or an X-Robots-Tag HTTP header |
| Scope | Whole sites, directories or URL patterns in a few lines | Each page or file individually, or groups of files through server rules |
| Must the URL be crawled? | No; compliant crawlers skip disallowed URLs entirely | Yes; the crawler has to fetch the page to read the directive |
| Keeps URLs out of results | Not reliably; a blocked URL can still be indexed from links to it | Yes, once search engines recrawl the page |
| Non-HTML files | Works for any URL | Only through the X-Robots-Tag header |
| Standard | Robots Exclusion Protocol, published as RFC 9309 in 2022 | A search engine convention supported by major search engines |
| Security | Not access control; the file is public and compliance is voluntary | Not access control; the page stays publicly reachable |

## How robots.txt works

A robots.txt file sits at the root of a host and lists rules for crawlers by user agent, mainly Disallow and Allow lines that match URL paths. It can also point crawlers to XML sitemaps. Well-behaved crawlers read it before fetching other URLs and skip anything they are told not to visit, which makes it an efficient way to keep bots out of large areas such as internal search results or endless filtered URL variations.

robots.txt only controls crawling. If other pages link to a disallowed URL, a search engine can still index the address and show it in results, usually without a description, because it was never allowed to read the page. The file is also public and voluntary, so it can reveal paths and does nothing to stop crawlers that ignore it.

## How noindex works

noindex is a value of the robots meta tag, placed in a page's HTML head, or of the X-Robots-Tag HTTP header, which also works for PDFs, images and other files. When a search engine crawls a URL and finds noindex, it drops that URL from its results or never adds it. The directive can apply to all crawlers or to a named one, such as Googlebot.

Because the directive lives on the page itself, a search engine has to be allowed to crawl the page to see it. Removal happens only after the page is recrawled, and the page stays available to anyone who visits it directly. Google stopped supporting noindex rules inside robots.txt in 2019, so the meta tag or header is the reliable way to set it.

## Using them together

A common mistake is to add noindex to a page and also block it in robots.txt. The robots.txt rule stops crawlers from fetching the page, so they never see the noindex, and the URL can stay in search results. To remove a page that is already indexed, leave it crawlable with noindex until it drops out, and only then block it in robots.txt if you also want to stop crawling.

Neither method protects private content. Pages the public shouldn't see need authentication, or they should be removed and return a 404 or 410 status.

## When to use robots.txt

Use robots.txt to manage crawling: keep bots away from endless URL variations, internal search results and other sections that add no value in search and waste crawler requests, and list your sitemaps. It is the right tool when the goal is to reduce crawling rather than to remove specific pages from results.

Don't use it to hide a page from search results, and don't use it on pages that carry a noindex directive.

## When to use noindex

Use noindex for pages people can reach but that shouldn't appear in search results, such as thank-you pages, login pages, thin tag or archive pages and other pages with no search value. Use the X-Robots-Tag header for files such as PDFs.

Keep noindexed pages crawlable, and leave them out of your XML sitemaps, since a sitemap tells search engines which URLs you want indexed.

## The verdict

Use robots.txt when you want crawlers to stop requesting URLs, and noindex when you want a page kept out of search results. They answer different questions, crawling versus indexing, so choose based on the outcome you need. For a page that must not appear in results, noindex is the reliable choice, as long as robots.txt doesn't block it. For anything truly private, use neither on its own; require a login.

## Definitions

- [What is robots.txt?](https://glossary.io/robots-txt/)
- [What is noindex?](https://glossary.io/noindex/)
- [All comparisons](https://glossary.io/compare/)

Published November 23, 2026.
