Noindex vs robots.txt disallow: which one to use
One controls indexing, the other controls crawling. Combine them on the same page and Google never sees the noindex. How to pick the right one and fix the mix-ups.

On this page▾
- What each one does
- Side by side
- When to use noindex
- When to use a canonical tag instead
- When to use robots.txt Disallow
- The common mistake: blocking a page you want removed
- How to fix "Indexed, though blocked by robots.txt"
- The other mistake: blocking pages you want to rank
- Where to edit robots.txt and noindex
- Other rules worth knowing
- Frequently asked questions
- Catch the accidental ones automatically
Use noindex when you want a page kept out of Google's search results. Use a robots.txt Disallow when you want crawlers to stop requesting a URL, usually to save server load on large or endless sections, and you can accept that the URL might still appear in results. They do different jobs, and putting both on the same page is a common mistake: if robots.txt blocks a page, Google cannot crawl it, never sees the noindex, and the page can stay indexed.
noindexcontrols indexing. Google has to crawl the page to see it, so the page must not be blocked in robots.txt.Disallowcontrols crawling. A disallowed URL can still be indexed, without its content, if other pages link to it.- Google stopped honouring
noindexlines inside robots.txt on 1 September 2019. Use a meta tag or anX-Robots-Tagheader. - To remove a page that is both blocked and indexed, remove the
Disallowfirst, keep thenoindex, and let Google recrawl.
What each one does
noindex: keep this page out of search results
noindex is a rule Google reads from the page itself, in one of two forms. As a meta tag in the HTML head:
<meta name="robots" content="noindex">
Or as an HTTP response header, which also works for PDFs, images and other files that have no HTML head:
X-Robots-Tag: noindex
When Googlebot crawls the page and finds either one, it drops the page from search results, even if other sites link to it. Google's guide to blocking indexing is explicit that this only works if the crawler can reach the page: if robots.txt blocks it, or the page cannot be accessed, the rule is never seen. To target only Google's crawler, use <meta name="googlebot" content="noindex">. The full list of directives is in Google's robots meta tag reference.
Disallow: do not crawl this URL
robots.txt sits at the root of a host, for example https://example.com/robots.txt, and tells crawlers which paths they may request:
User-agent: * Disallow: /cart/ Disallow: /search
Google's introduction to robots.txt states the limitation directly: robots.txt is not a mechanism for keeping a web page out of Google. A blocked URL can still be indexed if it is linked from elsewhere. Google does not know what is on it, so the result shows the URL and usually no description, and Search Console reports it as "Indexed, though blocked by robots.txt".
Side by side
noindex (meta tag or header) | robots.txt Disallow | |
|---|---|---|
| Controls | Whether a page appears in results | Whether a crawler requests the URL |
| Where it lives | In the page's HTML or HTTP headers | One file at the root of each host |
| Google must crawl the page to obey it | Yes | No |
| Can the URL still appear in Google | No, once Google has recrawled it | Yes, if other pages link to it |
| Reduces crawling | No, the page is still crawled | Yes |
| Works for PDFs and images | Yes, with X-Robots-Tag | Yes |
| Typical use | Thank-you pages, internal search results, thin tag pages | Faceted URLs, endless calendars, admin paths, expensive endpoints |
When to use noindex
Use it for pages people may reach but that should not be search landing pages:
- Thank-you and confirmation pages after a form or purchase.
- Internal search result pages, which create endless thin URLs.
- Tag and filter pages with little unique content.
- Logged-in account pages that might be linked publicly.
- Staging and preview sites, as a second layer behind password protection. Only the password keeps people out.
When to use a canonical tag instead
If a page is a near-duplicate of another page, such as a product reached through two category paths or a URL with tracking parameters, neither directive is the best fit. A rel="canonical" link pointing to the main version tells Google which URL to show and consolidates signals onto it, instead of discarding the duplicate. Our canonical tag checker shows what a page currently declares.
Do not combine noindex and a canonical pointing to another page. One says "drop this page", the other says "this page is the same as that one", and the two signals conflict.
When to use robots.txt Disallow
Use it when the problem is crawling:
- Faceted navigation that generates huge numbers of parameter combinations, such as
?color=red&size=42&sort=price. - Calendars or archives that link forever into the future.
- Endpoints that are expensive to generate, such as search or export URLs.
- Paths with no value to a search engine, such as
/cgi-bin/. WordPress's default robots.txt blocks/wp-admin/and allows/wp-admin/admin-ajax.php.
Google's crawl budget guide is written for large sites: roughly a million or more unique pages whose content changes about weekly, or 10,000 or more pages that change daily. Google adds that these are not exact thresholds. For a company site of a few hundred pages, robots.txt is about keeping crawlers out of areas that are pointless or expensive, and crawl budget is rarely the issue.
Do not block CSS and JavaScript files. Google renders pages much as a browser does, and blocked resources can make a page look broken or empty to it.
The common mistake: blocking a page you want removed
A typical sequence:
- Someone notices pages that should not be in Google, for example
/internal-search?q=...URLs. - They add
noindexto those pages. - To be thorough, they also add
Disallow: /internal-searchto robots.txt. - Google stops crawling those URLs, never sees the new
noindex, and the pages stay in the index as "Indexed, though blocked by robots.txt".
How to fix "Indexed, though blocked by robots.txt"
First decide whether the URLs should be in Google at all, then pick the matching fix:
| Situation | Fix |
|---|---|
| The pages should rank | Remove the Disallow rule that blocks them |
| The pages should not be in Google | Remove the Disallow, add noindex, and let Google recrawl |
| The pages should not exist | Return 404 or 410 |
| The pages are private | Put them behind a login |
| The URLs are duplicates of other pages | Allow crawling and add a canonical to the main version |
For the most common case, keeping pages out of Google:
- Remove the
Disallowrule for those URLs from robots.txt. - Confirm the
noindextag or header is present. Our noindex checker shows both the meta tag and theX-Robots-Tagheader, which is easy to miss if you only read the HTML. - Remove the URLs from your XML sitemaps. A sitemap should list only pages you want indexed.
- In Search Console, open the issue in the Page indexing report and click Validate fix, or request recrawling of a few important URLs with the URL Inspection tool.
- If crawl load is a real concern, you can restore the
Disallowonce the pages have dropped out. A URL that keeps attracting new links can then reappear as a URL-only result, so leave it crawlable if that happens.
If you need a page gone immediately, for example after publishing something by mistake, the Removals tool hides it for about six months. It is temporary; you still need noindex, a 404 or 410, or password protection for a permanent result.
The other mistake: blocking pages you want to rank
The opposite error does more damage, because it removes pages that bring traffic. It often comes from two lines:
User-agent: * Disallow: /
That blocks the entire host. It is a common robots.txt for staging sites, and it reaches production when a staging copy is promoted or a site is migrated without changing the file. A noindex left on after launch has the same effect page by page; WordPress's "Discourage search engines from indexing this site" setting adds one to every page.
In Search Console, the pattern is a sudden rise in pages excluded because they are blocked by robots.txt or marked noindex, followed by falling impressions. By the time it shows up there, it has usually been live for days.
Our robots.txt tester fetches a site's live robots.txt, tests a URL against it for Googlebot and shows the line that matches. Run it against your staging host before a robots.txt change reaches production, and against production right after a launch.
Where to edit robots.txt and noindex
- WordPress serves a virtual robots.txt unless a real file exists in the site root. Yoast and Rank Math both include a robots.txt editor. Per page, Yoast's "Allow search engines to show this content in search results?" setting and Rank Math's Robots Meta "No Index" option control
noindex. - Shopify generates robots.txt from a
robots.txt.liquidtemplate, which you can edit in the theme code. - Static sites and custom apps: robots.txt is a file in the public root, and
noindexgoes in the page template or the server's response headers.
Other rules worth knowing
- `noindex` in robots.txt does nothing. Google announced in July 2019 that it would stop supporting
Noindex:lines in robots.txt on 1 September 2019. - `nofollow` is a different directive. It tells search engines not to follow links on a page, or one link with
rel="nofollow". It does not keep the page itself out of the index. - A 404 or 410 also removes a page. If a page should not exist, returning 404 or 410 is cleaner than keeping it alive with
noindex. - Each host, protocol and port has its own robots.txt.
shop.example.comdoes not inherit the file fromexample.com, andhttpandhttpsare treated separately, according to Google's robots.txt specification. - Paths are case-sensitive.
Disallow: /Privatedoes not block/private. - Google caches robots.txt, generally for up to 24 hours, so a change does not take effect the moment you upload it.
- robots.txt is public. Anyone can read it, so listing private paths there advertises them. Protect private content with a login.
Frequently asked questions
Does robots.txt prevent indexing?
No. It prevents crawling. Google can still index a blocked URL from links pointing to it, without knowing its content. Use noindex to keep a page out of results.
Does Google crawl pages with noindex?
Yes. It has to crawl a page to read the tag, so a noindex page stays crawlable while it is kept out of results.
Can I use noindex and Disallow together?
Not on the same URL if you want the noindex to work. The Disallow stops Google from seeing it. Use noindex alone, and add a Disallow later only once the pages have dropped out of the index.
Should noindex pages be in my sitemap?
No. List only the URLs you want indexed. A sitemap entry that is marked noindex or blocked by robots.txt sends Google contradictory signals.
Catch the accidental ones automatically
Both directives can be changed by one line in a template, a plugin setting or a deploy script, and neither is visible to someone browsing the site.
PageRipple's SEO monitoring checks the meta robots tag and X-Robots-Tag header of each watched URL every morning. If a page that was indexable turns noindex, you get an alert with the before and after on the next daily check. It does not watch robots.txt, so test that file again after each deploy.

Olivia's guides cover changes that slip through after a deployment: titles, canonicals, indexing directives, redirects and pricing pages.



