Robots.txt vs Noindex: Which Keeps a Page Out of Search
Robots.txt vs noindex: one blocks crawling, the other blocks indexing, and using both at once keeps the page in search. Here is how to pick correctly.

Robots.txt vs noindex is the most consequential either/or in technical SEO, and the wrong pick doesn't merely fail. It can lock a page into the index and remove your ability to get it out. The two directives sound interchangeable and do completely different jobs: one refuses the fetch, the other refuses the storage. Below is the timing model that explains every edge case, a truth table for all four combinations, and the exact order to remove a page so it actually disappears.
The short answer
Robots.txt keeps a crawler off the page. noindex keeps the page out of the index. Only one of those is a removal tool, and it's noindex.
If you want a page gone from search results, serve noindex and let the crawler reach it. If you want to stop wasting crawl activity on URLs that were never going to be indexed anyway, use robots.txt. If you apply both to the same URL, you get the worst outcome on the menu: the page can stay in the index, and you've made it impossible for the engine to ever learn otherwise.
| robots.txt `Disallow` | `noindex` | |
|---|---|---|
| What it stops | The fetch | Storing and serving the page |
| Where it lives | One file at the root of the host | Per URL: a meta tag in `` or an HTTP header |
| Needs a crawl to work | No | Yes |
| Removes a URL from the index | No | Yes |
| URL can still appear in results | Yes, as a bare URL with no description | No, once recrawled |
| Saves crawl activity | Yes | No, the page has to be fetched |
| Hides the content from people | No | No |
| Scope | Path prefixes, per host and protocol | Only the URL it's served on |
That table is the whole argument. The rest of this post is why each row is true and what to do about it. If you want the wider context these two directives sit inside, start with what technical SEO covers and come back.
What each directive actually controls
robots.txt
A plain text file that must live at the root of a host, at exactly https://www.sparkcliks.com/robots.txt for that hostname. It governs one protocol, one host and one port. A file on www.sparkcliks.com says nothing about a different subdomain, and a crawler will look for a separate robots.txt there.
Here's the real file that host serves, trimmed for length:
User-agent: *
Disallow: /admin
Disallow: /api
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: PerplexityBot
Allow: /
Disallow: /admin
Disallow: /api
Sitemap: https://www.sparkcliks.com/sitemap.xml
Sitemap: https://www.sparkcliks.com/blog/sitemap.xml
Three things to read off it. Rules match by path prefix and are case sensitive, so Disallow: /admin also blocks /admin-tools, while /Admin is a different path entirely. Groups are addressed to named user agents, which is how a site makes a different decision for AI crawlers than for search crawlers, a choice worth making deliberately if you care how AI assistants pick sources. And Sitemap: lines are a discovery aid, not an access rule.
The protocol was an informal convention from 1994 until September 2022, when it was published as RFC 9309. Major crawlers honor it. Nothing in the file forces a badly behaved bot to.
noindex
A per-URL instruction, delivered one of two ways:
<meta name="robots" content="noindex">
or as a response header:
X-Robots-Tag: noindex
The meta tag has to be in , and it has to survive rendering. A tag injected by client-side JavaScript into the body, or added after the renderer has already snapshotted the document, is a tag the engine may never act on.
noindex and nofollow are separate directives that get typed together out of habit. noindex, follow keeps the crawler walking the links on the page. noindex, nofollow tells it to stop doing that too. Reach for the second only when you mean it.
Stuck on page two?
Real human clicks that lift your CTR and move you up the rankings.
The timing model that explains every edge case
Every confusing behavior in this topic falls out of a single fact: the two directives act at different moments, and robots.txt acts first.
| Stage | What happens | robots.txt | `noindex` |
|---|---|---|---|
| 1. Discovery | The engine learns the URL exists | No effect | No effect |
| 2. Fetch | The crawler requests the URL | Blocks here | No effect, not read yet |
| 3. Parse and render | The response is processed | Already blocked | Read here |
| 4. Index | The engine decides to store the page | Never reached | Blocks here |
| 5. Serve | The page is eligible for results | The bare URL may still be served | Not served |
Row 1 is the one everybody skips, and it's the one that matters. A search engine can learn a URL exists without ever fetching it: an inbound link from another site, an internal link, a sitemap entry, a redirect target, a mention in a public document. Robots.txt has no effect on discovery. It only refuses the fetch.
So a disallowed URL is a URL the engine knows about and is forbidden from examining. Google's own documentation states the consequence plainly: robots.txt is not a mechanism for keeping a page out of search results, and a blocked URL that other pages link to can still be indexed, just without a description, because the crawler was never allowed to read one.
Robots.txt vs noindex: all four combinations
Two directives, two states each, four outcomes. Only one of them is a removal.
| robots.txt | `noindex` | What the engine can do | Typical result |
|---|---|---|---|
| Allowed | Absent | Fetch, read, store | Indexed normally |
| Allowed | Present | Fetch, read, obey | Dropped at the next crawl. **This is the removal path** |
| Disallowed | Absent | Discover only | Usually absent, but can appear as a bare URL if linked |
| Disallowed | Present | Discover only, directive never read | Same as above, and the `noindex` does nothing at all |
Row four is where sites get stuck. The directive that would remove the page is sitting inside a document the crawler has been forbidden to open.
The trap: blocking a page can keep it in search
The failure is common enough that Search Console has a dedicated status for it. Someone finds an internal search results page or a thin tag archive in the index, wants it gone, and does the thorough thing: noindex on the template and a Disallow in robots.txt. Both directives, maximum coverage.
The crawler now stops fetching the URL, so it never sees the noindex. The page was already indexed, so it stays indexed and can keep appearing as a bare listing. Weeks later it's still there, so the team adds a broader disallow, which makes the problem harder rather than easier.
Google Search Console distinguishes these cases in the Pages report, and the labels are precise:
| Status | What it means | Is it a problem |
|---|---|---|
| Blocked by robots.txt | Fetch refused, URL not in the index | Fine, if the block is intentional |
| Indexed, though blocked by robots.txt | Fetch refused, URL is in the index anyway | Yes. This is the trap |
| Excluded by `noindex` tag | Fetched, read, deliberately not stored | Fine, and it's what a working removal looks like |
"Indexed, though blocked by robots.txt" is the alarm. The fix is counterintuitive and it is the whole point of this post: remove the block so the crawler can come in and read the noindex you already wrote.
Which one to use, by what you are protecting
The question is never which directive is better. It's what you're actually trying to prevent.
| Your real goal | Right tool | Why |
|---|---|---|
| Get an indexed page out of results | `noindex`, and keep the URL crawlable | Only `noindex` removes |
| Keep a new page out from launch | `noindex` from day one | Blocking an undiscovered URL also works, right up until someone links to it |
| Stop crawl waste on infinite filter and sort URLs | robots.txt `Disallow` | The goal is to prevent the fetch, and these were never index candidates |
| Keep a staging site private | HTTP authentication | Neither directive hides anything from a person |
| Remove a PDF, image or CSV | `X-Robots-Tag` header | There's no HTML head to put a meta tag in |
| Hide something urgently, today | Removals tool first, `noindex` behind it | The tool is temporary, roughly six months |
| Consolidate near-duplicate pages | `rel=canonical`, not `noindex` | A canonical merges the pages and keeps their signals. `noindex` discards the page instead |
| Control AI training and answer crawlers | robots.txt, addressed to the named agents | They're separate user agents, honored by convention |
The canonical row is the one that quietly costs the most. Teams reach for noindex on duplicate product or location pages when what they wanted was consolidation. noindex throws the page away. A canonical folds it into the version you kept.
Worked example: audit both directives in Search Console
Free, and it takes about twenty minutes. Every number below is an illustrative example, not SparkCliks data.
Step 1: pull the three statuses that matter. In Google Search Console, open Indexing, then Pages, and read the "Why pages aren't indexed" table. Find these three rows and write down each count:
- Blocked by robots.txt
- Indexed, though blocked by robots.txt
- Excluded by
noindextag
Say you see 2,140 blocked, 61 indexed though blocked, and 380 excluded by noindex. The 61 is your work list. It's small, it's specific, and it's the only one of the three that represents pages doing something you did not ask for.
Step 2: export and read the 61. Click the status, then use the export button. Ask one question per URL: did I ever want this indexed? If yes, remove the disallow and leave it alone. If no, remove the disallow and serve noindex. Both answers start with removing the disallow.
Step 3: confirm what the crawler sees, not what your browser sees. Paste a sample URL into the search bar at the top of Search Console to open URL Inspection, then click Test live URL. Read the two fields named Crawl allowed? and Indexing allowed?. Those are the two directives, reported separately, for that exact URL. A page you intend to remove should read crawl allowed Yes and indexing allowed No. Any other combination is a misconfiguration.
Step 4: read the robots.txt report. Under Settings, open the robots.txt report to see the fetched file, its last fetch time and any parse errors. The old robots.txt Tester was retired in December 2023, so guides pointing you at it are out of date.
Step 5: run the intersection check almost nobody runs. Take the URL list from your XML sitemap and the disallow rules from robots.txt, and find the overlap. Every URL that appears in both is a direct contradiction: you're asking the engine to crawl a page you've forbidden it to crawl. Then do the same for noindex, since a noindex URL sitting permanently in your sitemap is the same mixed message pointed the other way. Two lists, one comparison, and it surfaces conflicts no single report will show you.
How to remove a page from search, in order
The order is the part that goes wrong. Run it top to bottom.
- Decide the destination state first. Gone forever (return 404 or 410), live for users but out of search (
noindex), or merged into another URL (301 or canonical). These need different work and produce different reports. - Remove any robots.txt disallow covering the URL. Do this before anything else. Every step below depends on the crawler being able to fetch the page.
- Serve the
noindex. Verify it with a raw fetch or view-source, not by trusting your CMS toggle. Check the response headers as well as the HTML, because a strayX-Robots-Tagat the server can contradict your meta tag. - Leave the URL in your sitemap for now. It's a mixed signal long term, and a deliberate accelerator short term: the sitemap entry helps the engine come back and see the new directive sooner. Remove the entry once the page has dropped.
- Request indexing via URL Inspection for your handful of highest-priority URLs. It's a queue nudge, not a guarantee, and it doesn't scale past a few pages.
- If it's urgent, add the Removals tool on top. It hides the URL for about six months, which buys time while
noindexdoes the permanent work. Used alone it's a snooze button, and the page returns when it expires. - Verify the status flipped. In the Pages report, the URL should move to "Excluded by
noindextag". That's confirmation the engine fetched the page and obeyed. - Only now, consider re-adding a robots.txt disallow, and usually don't. It's defensible for a large set of URLs where crawl waste is real and you've confirmed every one has dropped. For a handful of pages it buys nothing and re-arms the trap.
Timing is the part to set expectations on. Recrawl frequency varies from about a day for a heavily linked page to months for a deep, rarely linked one. There's no setting that changes this. If a page hasn't been rechecked, no directive on it has taken effect yet.
When there is no HTML head: X-Robots-Tag
A PDF has no . Neither does an image, a CSV export or a JSON endpoint. All of them can be indexed. The HTTP header is how you apply robots directives to them.
Nginx, applied to PDFs:
location ~* \.pdf$ {
add_header X-Robots-Tag "noindex, nofollow";
}
Apache, the same rule:
<FilesMatch "\.pdf$">
Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
Two cautions. The header carries exactly the same crawl requirement as the meta tag, so a blocked URL means an unread header and the trap applies identically. And because these rules are set at the server, they're easy to scope too broadly. A server-level noindex meant for a staging environment, shipped to production by a config copy, is one of the fastest ways to remove an entire site from search. Grep your server config for X-Robots-Tag the same way you'd grep your templates for noindex.
Advice that was correct once and is now wrong
This topic has an unusually long tail of stale guidance still ranking.
| Old advice | Status | What changed |
|---|---|---|
| Put `noindex: /path` inside robots.txt | Dead | Google announced on July 2, 2019 that it would stop honoring unsupported robots.txt rules, effective September 1, 2019. It was never part of the standard |
| Use the robots.txt Tester in Search Console | Gone | Retired in December 2023, replaced by the robots.txt report under Settings |
| Set `Crawl-delay` to slow the crawler down | Ignored by Google | Not a supported directive. Some other engines honor it |
| Use the Removals tool to delete a page | Incomplete | It hides the URL for roughly six months. Without `noindex` behind it, the page comes back |
| Keep pages on `noindex, follow` as link conduits | Unreliable | Google has said in office-hours guidance that links on a long-term `noindex` page tend to get treated as `nofollow` over time. That's stated guidance, not documentation, so treat it as a reason not to build a strategy on it |
The first row is the expensive one. A noindex line in robots.txt has done nothing since September 2019, and it fails silently: the file parses, the report shows no error, and the page stays indexed.
Neither one is a security control
Robots.txt is a public file. Anyone can read yours, and people do. Listing a path there announces that the path exists and that you'd rather nobody looked at it, which is the opposite of concealment.
Look back at the real file quoted earlier: it disallows /admin and /api. That's fine, because those routes are protected by authentication. The disallow is a crawl-efficiency measure, and the authentication is the actual control. The failure mode is a site that has the disallow and not the authentication, treating the robots file as the lock.
noindex hides nothing either. The page still returns 200 to anyone holding the URL, it still renders, and it can still be shared, archived and scraped. It's an instruction about search results, not about access.
If content genuinely must not be reachable, the controls are HTTP authentication, a login wall, an IP allowlist, or not publishing it. Use robots.txt and noindex for what they are: crawl management and index management, in that order.
Indexed or not indexed is a binary, and it sits upstream of everything else. Whether anyone then picks your listing out of ten results is a separate question with a far less settled answer: what search engines say about click data as a ranking signal. SERP Clicks states the same limit in its own FAQ, because no click behavior of any kind moves a page that isn't in the index to begin with.
Frequently asked questions
FAQ
No. Robots.txt blocks the fetch, not the listing. A blocked URL that other pages link to can still be indexed and shown as a bare URL with no description, because the crawler was never allowed to read the page or any directive on it.
The two usual causes are that the URL is also disallowed in robots.txt, so the crawler can't fetch the page to see the noindex, or that the page simply hasn't been recrawled yet. Check Crawl allowed? and Indexing allowed? in URL Inspection to tell the two apart.
You can, and on the same URL it's almost always a mistake. The disallow prevents the crawler from reading the noindex, so the removal never happens. Block a page from search results with noindex alone, and keep the URL crawlable until it has dropped out.
It takes effect at the next crawl of that URL, which can be a day or several months depending on how often the engine visits. Keeping the URL in your sitemap temporarily and requesting indexing in URL Inspection both help it get rechecked sooner.
Use a canonical when the pages are variants of one thing and you want their signals consolidated onto the version you keep. Use noindex when the page has no business being in the index at all, since it discards the page rather than merging it.
Use the X-Robots-Tag HTTP response header, since non-HTML files have no for a meta tag. Set it in your server config for the matching file extension, and make sure the URL isn't disallowed in robots.txt, or the header is never read.
Related articles

How to Submit a Sitemap and Check Indexed Pages
Submit a sitemap in minutes, then use the per sitemap filter in the Page indexing report to see exactly which of your submitted URLs got indexed.

Crawled but Not Indexed: What the Status Really Means
Crawled but not indexed means a search engine fetched your page and declined to store it. Here is what that verdict means and how to diagnose it.

What Is Technical SEO and Why It Comes First
Technical SEO is what lets a search engine find, crawl, render and index your pages. Here is what it covers, why it comes first, and how to audit it.
