Noindex Tag Guide with Syntax, Robots.txt Pitfalls and Fixes

Contents+
- 01What is a noindex tag?
- 02Noindex syntax for the robots meta tag
- 03Noindex with the X-Robots-Tag HTTP header
- 04Why a page blocked by robots.txt can't be noindexed
- 05When should you use noindex?
- 06What "Excluded by ‘noindex’ tag" means in Search Console
- 07Common ways noindex gets added by accident
- 08How to diagnose "Excluded by ‘noindex’ tag" step by step
- 09How to remove a noindex tag and recover the page
A noindex tag is a rule that tells search engines to keep a page out of their search results. You add it as a robots meta tag in the page's HTML or as an X-Robots-Tag HTTP header. Google drops the page from Search the next time it crawls the page and sees the rule.
This guide covers the syntax for both forms and the robots.txt trap that hides a noindex from Google. It also explains the "Excluded by ‘noindex’ tag" status in Search Console and the accidents that put it on pages you want ranking.
What is a noindex tag?
Google's robots meta tag documentation defines the noindex rule in one line. "Do not show this page, media, or resource in search results." Without it, a crawlable page may be indexed and shown.
Noindex controls indexing. Googlebot still has to crawl the page to read the rule. Robots.txt works on the crawling side and can't keep a URL out of the index on its own.
Google's noindex guide notes that "some search engines might interpret the noindex rule differently." This guide follows Google's documentation.
Noindex syntax for the robots meta tag
The meta tag version goes in the <head> of the page.
<meta name="robots" content="noindex">
A name of robots applies to every crawler that supports the rule. To target Google's web search crawler alone, use googlebot as the name.
<meta name="googlebot" content="noindex">
You can combine rules with commas, as in content="noindex, nofollow", or with separate meta tags. Google's documentation says "the more restrictive rule applies" when rules conflict. A stray noindex in a second tag beats an index in the first.
Google's robots meta tag page also says Google Search doesn't enforce placement in the head and will honor tags it finds in the body. Its instructions still place the tag in the head. Follow that.
Noindex with the X-Robots-Tag HTTP header
The header version travels with the HTTP response.
HTTP/1.1 200 OK
X-Robots-Tag: noindex
Google recommends the header for non-HTML files such as PDFs, images and video, which have no <head> to hold a meta tag. Google's page includes Apache and NGINX examples that add the header to every PDF on a site.
| Question | Robots meta tag | X-Robots-Tag header |
|---|---|---|
| Where it lives | Page HTML, in the head | HTTP response headers |
| Works for PDFs and images | No | Yes |
| Who usually controls it | CMS, theme or SEO plugin | Server, CDN or framework config |
| How to check it | View source or View crawled page in URL Inspection | curl -I or the HTTP response in URL Inspection |
| Easy to miss in an audit | Less so | Yes, because it never shows in the page source |
Why a page blocked by robots.txt can't be noindexed
Google has to fetch a page to read its noindex. The noindex guide is blunt about it. "If the page is blocked by a robots.txt file or the crawler can't access the page, the crawler will never see the noindex rule."
That's why a disallowed page can still appear in Google. The robots.txt introduction says a blocked URL "can still be indexed if linked to from other sites." Search Console reports that case as "Indexed, though blocked by robots.txt."
The fix order matters. Allow crawling first. Keep the noindex in place and let Google recrawl the page. Add the robots.txt disallow back only after the page has left the index, if you want it at all.
Putting noindex inside robots.txt doesn't work either. Google retired support for that rule on September 1, 2019. For crawler-by-crawler rules that do belong in robots.txt, see our guide to segmenting AI crawlers in robots.txt.
URL Inspection has a matching blind spot. Its documentation says that when robots.txt blocks a page, the live test shows Indexing allowed as Yes "because Google can't see and respect any noindex directives."
When should you use noindex?
Use noindex on pages people can reach that searchers have no reason to land on. Typical examples are form thank-you pages, internal search results, account and checkout steps, and thin tag archives. Our own site sets it on registration and unsubscribe pages.
Pick another tool for these jobs.
| Goal | Better tool | Source |
|---|---|---|
| Choose between duplicate URLs on one site | rel="canonical" or a redirect | Google's canonical guide doesn't recommend noindex for this |
| Remove a page that no longer exists | Return 404 or 410 | Google's 2019 note on robots.txt rules |
| Keep private content private | Password protection | Google's robots.txt introduction |
| Hide a URL from results fast | The Removals tool in Search Console, which is temporary | Google's 2019 note on robots.txt rules |
A removed page that returns 200 with an empty template can land in a different bucket. Our guide to soft 404 errors covers that case.
What "Excluded by ‘noindex’ tag" means in Search Console
In the Page indexing report, pages Google skipped because of a noindex rule appear under "Excluded by ‘noindex’ tag." Google's Page indexing report help page lists the same reason under the heading "URL marked ‘noindex’" and explains it this way. "When Google tried to index the page it encountered a 'noindex' directive and therefore did not index it."
This row covers both forms. The meta tag and the HTTP header land in the same place. Google's noindex guide says you can use the report "to monitor the pages on your site from which Googlebot extracted a noindex rule."
Check what's in it. The status is fine when every URL in it is one you meant to exclude. It's a problem when the list holds product pages, blog posts or service pages. A sudden jump in the count after a release usually points to a template change.
Common ways noindex gets added by accident
Most accidents share one trait. A setting or header applies far beyond the page someone meant to change.
| Cause | How it happens | Where to look |
|---|---|---|
| WordPress search engine visibility | The "Discourage search engines from indexing this site" box outputs a sitewide noindex, nofollow meta tag in the page head since WordPress 5.3, per the Reading Settings documentation. A box ticked on staging can reach production when the database is copied over. | Settings, then Reading |
| Staging headers left in place | A server or CDN rule that adds X-Robots-Tag: noindex to a staging host gets copied to the live config. | Response headers on the live domain |
| Per-page CMS or plugin toggles | An SEO plugin's "no index" checkbox, or a default that noindexes a whole post type or taxonomy. | The plugin's page settings and content-type defaults |
| Framework metadata inheritance | In the Next.js App Router, metadata from a layout is merged into child routes. A robots: { index: false } on a shared layout reaches every page beneath it that doesn't set its own. | Layout files and the rendered head |
| Noindex in the HTML that JavaScript removes later | Google's JavaScript SEO basics warns that "when Google encounters the noindex tag, it may skip rendering and JavaScript execution." A script that strips the tag may never run for Googlebot. | Raw HTML before rendering |
| JavaScript that injects noindex | Error states, consent tools or test scripts that add a noindex meta tag in the browser. When rules conflict, Google applies the more restrictive one. | Rendered HTML in URL Inspection |
Google's advice on the JavaScript case is direct. "If you do want the page indexed, don't use a noindex tag in the original page code."
Platform defaults can also shape indexing in ways the editor never sees. Our Squarespace blog indexing fix is one example from a hosted CMS.
How to diagnose "Excluded by ‘noindex’ tag" step by step
- Open the Page indexing report. It sits under Indexing, then Pages, in the sidebar.
- In the "Why pages aren't indexed" table, click the noindex row and export the examples. The list is limited to 1,000 items.
- Sort the URLs into two groups. Keep the pages you meant to exclude and set them aside. Work only on the pages that should rank.
- Open one URL from each template in URL Inspection. Under Indexing allowed?, the indexed result shows whether noindex is preventing indexing.
- Click View crawled page. Check the HTML for a robots or googlebot meta tag and the HTTP response for an
X-Robots-Tagheader. - Run Test live URL to see whether the noindex is still there today. Remember the robots.txt blind spot above.
- Confirm the header from your own machine with
curl -I https://example.com/page. Header rules from a CDN or edge config are the easiest to overlook.
Google's noindex guide lists the usual reasons a noindexed page still appears in results. Google may not have crawled the page since the rule was added. The page may be blocked by robots.txt. The rule may not be visible to Googlebot at all.
How to remove a noindex tag and recover the page
- Remove the rule at its source. That might be a plugin toggle, a layout file, a server header or a CMS setting.
- Check that robots.txt allows the page. Google needs to crawl it to see the rule is gone.
- Make sure the page is in your XML sitemap and linked from relevant pages on your site.
- Inspect the URL and run Test live URL. Indexing allowed? should now show Yes with no noindex detected.
- Click Request Indexing for your most important URLs. URL Inspection sets a daily limit on these requests.
- Once a whole template is fixed, click Validate fix on the noindex row in the Page indexing report.
Recovery speed varies. It depends on crawl frequency. Google's noindex guide says that depending on the page's importance, "it may take months for Googlebot to revisit a page." Important pages tend to come back faster. Validation in the Page indexing report typically takes up to about two weeks and stops if Google finds a single remaining instance.
If the page then shows up as Crawled - currently not indexed or Discovered - currently not indexed, our guide to Crawled and Discovered currently not indexed covers the next step.
When a release noindexes part of your site and you need it traced fast, our technical SEO team can audit the templates and headers behind it.
See where your brand stands in AI answers today, benchmarked against your competitors, no pitch required.
Related reading
All posts →
Blocked by robots.txt in Search Console and How to Fix It
Blocked by robots.txt means a Disallow rule stopped Googlebot from crawling a URL. This guide shows how to find the rule, fix it for your goal and handle pages indexed despite the block.
Read post →
How to Set Bing AI Training and AI Grounding Controls
Bing now separates AI training from AI grounding. Training is set in robots.txt, grounding only page by page. Setup for meta tags, Cloudflare, Nginx and Apache.
Read post →
Alternate Page With Proper Canonical Tag and When to Ignore It
This Search Console status usually confirms your canonical tags work. Here is how to spot the few cases where a page you want ranking has landed in the list.
Read post →