Robots.txt is the plain text file at the root of your website that tells crawlers which URLs they may fetch. It no longer supports noindex, a directive that tells search engines to keep a page out of their results. Google stopped honoring Noindex: lines in robots.txt on September 1, 2019.
To keep a page out of search results, use a meta robots tag in the page's HTML or an X-Robots-Tag HTTP header. Both only work when crawlers can fetch the page, so the URL must stay open in robots.txt for Google to read the directive.
Robots.txt does not support noindex
Google retired robots.txt noindex in a July 2, 2019 post on the Search Central Blog. The post announced that Google was retiring all code that handled unsupported and unpublished rules on September 1, 2019. Google named noindex, nofollow, and crawl-delay as examples of rules that the internet draft for robots.txt did not support.
Google gave three reasons for the change:
- Never documented: Google had never published these rules, so very few websites used them with Googlebot.
- Contradictory usage: Other rules in the same file contradicted them in all but 0.001% of robots.txt files on the internet.
- Unintended damage: Google judged that these mistakes hurt websites' presence in search results in ways their owners had not intended.
The same post listed the replacements:
- A noindex rule in a robots meta tag or HTTP response header is the most effective way to remove URLs from the index when crawling is allowed.
- A 404 or 410 status code drops a URL once Google crawls and processes it.
- A login wall generally removes a page from the index.
How robots.txt and noindex work
Robots.txt controls crawling, which is when a bot such as Googlebot fetches a URL. Noindex controls indexing, when a search engine stores that page so it can appear in results. These separate stages explain why one control cannot replace the other.

Robots.txt controls crawling
Robots.txt tells crawlers which URLs they may fetch, and Google says the file is mainly for avoiding overload on your server. A user agent is the name a crawler uses to identify itself. A Disallow rule lists a path that the named user agent should not crawl.
For example, this file blocks every crawler from one directory and lets Googlebot-News crawl everything:
User-agent: *
Disallow: /internal-search/
User-agent: Googlebot-News
Allow: /Google's robots.txt specification sets out how Googlebot reads the file:
- Supported fields: Google supports
user-agent,allow,disallow, andsitemap, and ignores fields such ascrawl-delay. - One group per crawler: A crawler follows only the most specific group that matches its user agent, and the order of groups in the file does not matter.
- Conflicts: The longest matching path wins. When two rules match equally, Google uses the least restrictive one.
- Location and size: The file must sit in the top-level directory, applies only to its own protocol, host, and port, and Google ignores content past 500 KiB.
- Caching: Google generally caches the file for up to 24 hours.
Robots.txt also shapes crawl budget. Crawl budget is the set of URLs Google can and wants to crawl on your website, based on how much load your server handles and how much demand Google sees. Google's crawl budget guide aims at large websites with 1 million or more unique pages that change about weekly, websites with 10,000 or more pages that change daily, and websites where a large share of URLs sit in "Discovered - currently not indexed".
For those websites, blocking unimportant URLs such as differently sorted versions of the same page keeps Googlebot on the pages that matter. Google also warns against adding and removing robots.txt rules on a rotating basis to shift crawl budget around.
Noindex controls indexing
Noindex is the control that keeps a page out of results. When Googlebot crawls a page and extracts a noindex tag or header, Google drops that page entirely from Google Search results, even if other websites link to it. Mueller put the split in one line in 2017, describing noindex as an indexing directive that does not control crawling.
That means Google has to crawl the page to read the directive. If a noindexed page still shows in results, Google probably has not recrawled it since you added the tag.
Blocked URLs can still appear in search results
A Disallow rule does not keep a URL out of Google. Google won't crawl blocked content, but it can still index a disallowed URL when other pages on the web link to it. Google can use the URL and anchor text from those links. The result usually shows without a description, because Google never read the page.
In Search Console, these URLs appear in the Page indexing report with the warning "Indexed, though blocked by robots.txt". Google's help page explains that it indexed the page using information from the page that links to it, and that any snippet will probably be very limited. In live results, the listing may carry a "No page information" message, which Google's help article attributes to a robots.txt rule stopping Googlebot from reading the content.
Disallow stops crawlers from reading noindex
Adding a Disallow rule to a noindexed page defeats the tag. Google's robots meta tag specification says that if robots.txt blocks a page, Google never finds its indexing rules and ignores them. The URL Inspection tool shows this directly. For a page blocked by robots.txt, "Indexing allowed?" always reads "Yes", because Google cannot see the noindex. The page can still appear in results.
How to noindex a page correctly
Google supports two placements for noindex, and the noindex documentation says they have the same effect. Pick the one that fits the content type and how your website is built.

1. Add a meta robots noindex tag
The meta tag suits ordinary HTML pages that your CMS or templates already control. Place it in the <head> of the page:
<meta name="robots" content="noindex">The robots name applies the rule to every crawler that supports it. To target only Google, replace robots with googlebot:
<meta name="googlebot" content="noindex">You can combine rules in one tag, such as content="noindex, nofollow", or split them across separate tags. The none value equals noindex, nofollow. When rules conflict, Google applies the more restrictive one.
Put the tag in the original HTML. Google's JavaScript SEO basics page says Google may skip rendering when it encounters noindex, so JavaScript that later removes the tag may not work.
2. Send an X-Robots-Tag HTTP header
The X-Robots-Tag header suits files that have no HTML head. Google's specification says to use it to block indexing of PDFs, video files, and image files.
Any rule that works in a meta tag also works as a header. A response looks like this:
HTTP/1.1 200 OK
X-Robots-Tag: noindexGoogle's documentation gives server examples for all PDFs across a website. On Apache, add this to .htaccess or httpd.conf:
<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</Files>On NGINX, add this to the website's .conf file:
location ~* \.pdf$ {
add_header X-Robots-Tag "noindex, nofollow";
}Choose the header's scope and placement to fit your files and server configuration:
- Single file: Google's NGINX example uses an exact match such as
location = /secrets/unicorn.pdf. - Serving files: Add the header to the existing NGINX handler. Keep any file or proxy settings and confirm the affected URLs still return the expected file and status with a GET request.
- Header inheritance: The NGINX headers module documentation says NGINX inherits
add_headerdirectives from a parent level only if the current level defines none. So adding any header inside a location block can drop headers set higher up. - Header versus meta tag: Pick the header when the file is not HTML, when you want one server rule to cover a whole file type, or when you cannot edit page templates.
- Crawler-specific rule: The header can also name a crawler, as in
X-Robots-Tag: googlebot: noindex.
How to fix a robots.txt file that still contains noindex
Old Noindex: lines do nothing in Google today, so any page they were meant to hide may already be indexed. Work through the file in this order:
- Open
/robots.txtand find every line that starts withNoindex,Nofollow, orCrawl-delay. Google ignores all three. - List the URLs or paths each
Noindexline was meant to keep out of search. - Add a meta robots noindex tag to those HTML pages, or an X-Robots-Tag header for PDFs and other files.
- Remove any
Disallowrule that covers the same paths, so Googlebot can crawl the pages and read the new directive. - Delete the
Noindexlines from robots.txt. - Open the robots.txt report in Search Console and use "Request a recrawl" so Google picks up the new file faster than its usual 24-hour cache refresh.
- Inspect a sample of the affected URLs and confirm "Crawl allowed?" reads "Yes" and "Indexing allowed?" reads "No".
How to remove pages that are already indexed
Apply noindex first, keep the page crawlable until it drops out, and verify deindexing in Search Console. Google's Page indexing help says to remove the robots.txt block and use noindex, and its removed Robots FAQ explained why the page must be crawled for the tag to be seen and obeyed.

Wait for Google to recrawl the page and drop it. Keep the page crawlable for as long as you rely on noindex. A Disallow can hide the directive and allow a linked URL to return as a link-only result. If the page is permanently gone, serve a 404 or 410 instead.
To speed things up, use a temporary sitemap that lists the affected URLs with a last-modified date matching when you added noindex. Keep it for a few months and then remove it.
How to verify deindexing in Search Console
Three Search Console tools cover the checks:
- Page checks: The URL Inspection tool shows "Crawl allowed?" for robots.txt status and "Indexing allowed?" for noindex. Click "Test live URL" to check the current response. Keep the page crawlable, then check the indexed report after Google revisits it.
- Robots.txt checks: The robots.txt report lists the robots.txt files Google found for the top 20 hosts on your website, when it last crawled each one, and any errors. That report replaced the robots.txt Tester, which Google retired in November 2023.
- Temporary removal: The Removals tool hides a URL from results, usually within a day. The block lasts about six months. To make the removal permanent, return a 404 or 410, put the content behind a password, or add noindex. Google's help page says not to use robots.txt as the blocking mechanism.
Timelines vary with how visible a page is. Google's noindex documentation says Googlebot may take months to revisit a page.
Choose robots.txt or noindex for each use case
The right control depends on whether you want to stop crawling, stop indexing, or both. This table maps common cases to the control Google documents:
| Use case | Right control | Why |
|---|---|---|
| Duplicate URLs on one website | rel="canonical" or a 301 redirect | Google recommends against noindex for choosing a canonical because it blocks the page completely, and robots.txt can leave the URL indexed without content. |
| Thin or low-value pages | Improve the page, or noindex it if it stays | Google's spam policies say to exclude scaled low-value content you host from Search. Leave the page crawlable so Google reads the tag. |
| Staging or development website | Password protection | Google's robots.txt guide recommends password protection for keeping information from crawlers, because robots.txt cannot force a crawler to comply. |
| Crawl budget on a large website | Disallow in robots.txt | Google's crawl budget guide suggests blocking unimportant URLs, such as sorted duplicates, that you cannot consolidate. |
| PDFs, images, video files | X-Robots-Tag noindex header | Google's robots meta tag specification recommends this header for non-HTML files, which have no head for a meta tag. |
| Pages deleted for good | 404 or 410 status | Google's 2019 post explains that these status codes drop URLs from the index once Google crawls and processes them. |
How Bing and other search engines treat noindex in robots.txt
Bing, Yandex, and Apple all document noindex as a page-level directive rather than a robots.txt rule:
Bing
Bing's robots meta tag page lists noindex as a meta tag value and an X-Robots-Tag value, and says Bing must be able to crawl a page to see the tag. Bing's removal help adds that you should not block a file in robots.txt when you use an X-Robots-Tag noindex header, because Bing cannot read the header if it cannot reach the file.
Yandex
Yandex's robots.txt help lists User-agent, Disallow, Sitemap, Clean-param, and Allow as its directives. The same page says pages restricted in robots.txt can still appear in Yandex search, and that you remove them with noindex in the HTML or an HTTP header. Yandex's meta tags page says a meta tag or header does not apply to a page blocked in robots.txt.
Apple
Apple's Applebot page lists noindex among the robots meta tag rules Applebot supports. A noindexed page will not appear in Spotlight or Siri Suggestions. Applebot also reads the X-Robots-Tag header.
Indexing controls for search and AI engines
AI companies publish their own robots.txt user agents, and most separate training crawlers from search and user-triggered fetchers. Your website reaches buyers, AI engines, and training bots through the same pages, so each token controls a different audience.
The documented tokens include:
- OpenAI: GPTBot crawls content that may be used to train foundation models. OAI-SearchBot surfaces websites in ChatGPT search. ChatGPT-User handles user actions, and robots.txt rules may not apply to it.
- Google: Google-Extended is a robots.txt token with no crawler of its own. Disallowing it limits training and grounding for Gemini and other generative AI products, and it does not affect Google Search inclusion or ranking.
- Anthropic: ClaudeBot is the training crawler, and Claude-SearchBot and Claude-User support search and user queries. Anthropic says its bots honor robots.txt and supports
Crawl-delay. - Perplexity: PerplexityBot surfaces websites in Perplexity search. Perplexity-User fetches pages for user questions and generally ignores robots.txt.
- Apple: Applebot-Extended lets you opt out of training Apple's foundation models. Pages that disallow it can still appear in Apple search results.
- Common Crawl: CCBot checks robots.txt before fetching and stops crawling under
User-agent: CCBotandDisallow: /.
Noindex works differently. Google's generative AI controls page maps noindex to keeping a page out of Google Search completely, including AI Overviews and AI Mode. The page maps nosnippet, data-nosnippet, and max-snippet to limiting what content feeds those features. For OpenAI, Anthropic, Perplexity, and Common Crawl, robots.txt user agents are the documented control.
