SEO Fundamentals

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.

S SparkCliks 0 16 min read
Share
Robots.txt vs Noindex: Which Keeps a Page Out of Search

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 stopsThe fetchStoring and serving the page
Where it livesOne file at the root of the hostPer URL: a meta tag in `` or an HTTP header
Needs a crawl to workNoYes
Removes a URL from the indexNoYes
URL can still appear in resultsYes, as a bare URL with no descriptionNo, once recrawled
Saves crawl activityYesNo, the page has to be fetched
Hides the content from peopleNoNo
ScopePath prefixes, per host and protocolOnly 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.

Free trial

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.

StageWhat happensrobots.txt`noindex`
1. DiscoveryThe engine learns the URL existsNo effectNo effect
2. FetchThe crawler requests the URLBlocks hereNo effect, not read yet
3. Parse and renderThe response is processedAlready blockedRead here
4. IndexThe engine decides to store the pageNever reachedBlocks here
5. ServeThe page is eligible for resultsThe bare URL may still be servedNot 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 doTypical result
AllowedAbsentFetch, read, storeIndexed normally
AllowedPresentFetch, read, obeyDropped at the next crawl. **This is the removal path**
DisallowedAbsentDiscover onlyUsually absent, but can appear as a bare URL if linked
DisallowedPresentDiscover only, directive never readSame 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.

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 goalRight toolWhy
Get an indexed page out of results`noindex`, and keep the URL crawlableOnly `noindex` removes
Keep a new page out from launch`noindex` from day oneBlocking an undiscovered URL also works, right up until someone links to it
Stop crawl waste on infinite filter and sort URLsrobots.txt `Disallow`The goal is to prevent the fetch, and these were never index candidates
Keep a staging site privateHTTP authenticationNeither directive hides anything from a person
Remove a PDF, image or CSV`X-Robots-Tag` headerThere's no HTML head to put a meta tag in
Hide something urgently, todayRemovals tool first, `noindex` behind itThe 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 crawlersrobots.txt, addressed to the named agentsThey'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 noindex tag

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.

  1. 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.
  2. 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.
  3. 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 stray X-Robots-Tag at the server can contradict your meta tag.
  4. 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.
  5. 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.
  6. If it's urgent, add the Removals tool on top. It hides the URL for about six months, which buys time while noindex does the permanent work. Used alone it's a snooze button, and the page returns when it expires.
  7. Verify the status flipped. In the Pages report, the URL should move to "Excluded by noindex tag". That's confirmation the engine fetched the page and obeyed.
  8. 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 adviceStatusWhat changed
Put `noindex: /path` inside robots.txtDeadGoogle 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 ConsoleGoneRetired in December 2023, replaced by the robots.txt report under Settings
Set `Crawl-delay` to slow the crawler downIgnored by GoogleNot a supported directive. Some other engines honor it
Use the Removals tool to delete a pageIncompleteIt hides the URL for roughly six months. Without `noindex` behind it, the page comes back
Keep pages on `noindex, follow` as link conduitsUnreliableGoogle 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

Does robots.txt remove a page from search results?

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.

Why is my page still in search results after I added noindex?

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.

Can I use robots.txt and noindex together?

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.

How long does it take for noindex to remove a page?

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.

Should I use noindex or a canonical tag for duplicate pages?

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.

How do I noindex a PDF or an image?

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.

About the Author

The SparkCliks Team works on search click behavior, CTR measurement and website traffic quality. SparkCliks operates a crowd-sourced pool of real human clickers who search keywords and visit customer sites, plus automated traffic products, and publishes practical research covering the whole path from crawl to click. We state plainly where the evidence for a technique runs out, including for our own products. Learn more at sparkcliks.com.

Keep reading

Related articles

What Is Technical SEO and Why It Comes First

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.

SparkCliks·SEO Fundamentals