Knowledge hub
The noindex meta tag and X-Robots-Tag header
Noindex is the standard way to keep a live page out of search results. It is simple, but the details decide whether it works: where it goes, what it must not be combined with, and how to confirm that search engines can see it.
Key takeaways
- Use the robots meta tag for HTML pages and the X-Robots-Tag header for files and sitewide rules.
- The URL must not be blocked in robots.txt, or the directive is never seen.
- Never copy a staging noindex into production.
- Confirm with the live test in URL Inspection and the Page indexing report.
Two ways to say noindex
Google's block-indexing documentation describes two equivalent implementations.
Robots meta tag, placed in the <head> of an HTML page:
<meta name="robots" content="noindex">
HTTP response header, sent by the server for the response:
X-Robots-Tag: noindex
Both have the same effect. The header form works for non-HTML files such as PDFs, images and videos, where a meta tag cannot be added. A tag aimed only at Google's crawler can be written as <meta name="googlebot" content="noindex">. The full list of directives is in Google's robots meta tag specification.
The requirement people miss
For a noindex directive to work, the page must be crawlable. Google says the page must not be blocked by a robots.txt file, because the crawler would never fetch the page and never see the rule. The URL can still appear in results. Google also does not support specifying noindex inside robots.txt. This is the heart of why blocked pages are still indexed.
Implementation notes
- Put the tag in the served HTML. If JavaScript adds it after load, some crawlers may not see it as reliably as a server-rendered tag. A header or server-rendered tag is the safer choice.
- Use the header for files. Configure it at the web server, CDN or application level for file types or directories.
- Avoid contradictions. A page that says
noindexin one place andindexin another can be handled unpredictably. Keep one clear instruction per page. - Do not add a canonical to a different page and noindex at once without thought. The signals interact, and conflicting instructions are harder to reason about. Google generally advises against using noindex for canonicalisation, which is described in its duplicate URL guidance.
- Keep it in place. Removing noindex later invites the page back into the index at the next crawl.
Verifying
- Use the live test in URL Inspection to see how Google fetches the URL and whether indexing is allowed.
- Check the served response headers and source from outside your network.
- Watch the Page indexing report for the reason excluded by noindex tag. That reason confirms Google has seen the directive.
- Make sure no robots.txt rule blocks the URL, or the previous steps will not show anything useful.
Timing
After you add the directive, the page may stay in results until it is recrawled, as noted in Google's guidance. A recrawl can be requested, but is not guaranteed. A temporary request in the Removals tool can hide the page while you wait. We do not promise dates. See how long deindexing takes.
Bing
Bing also honours the robots meta tag and X-Robots-Tag. Confirm behaviour for your site in Bing Webmaster Tools, because crawl timing is separate from Google's.
Noindex and links
A noindexed page can still be crawled, and links on it can still be discovered and followed, unless you also tell crawlers otherwise. For a page that should be out of the index but whose links matter, that is usually fine. If you want to prevent following links, other directives exist, though over the long term Google has said that a noindexed page that stays noindexed may eventually be treated as if links on it are not followed. We do not rely on this as a technique.
Common mistakes
- A sitewide noindex copied from staging into production. This is among the most damaging mistakes because it removes a live site from results. Include a check in your deployment pipeline.
- Noindex on a page that is the target of canonical tags from other pages.
- Noindex on pages in an XML sitemap. It is better to remove those from the sitemap, or at least be intentional about it. See sitemap cleanup for deindexing.
- Using noindex on a URL you actually want removed permanently, when a 410 would be cleaner.
When to use something else
If a page is gone for good, return a 410 or 404 instead. If it is private, protect it with a login. For a large pattern of URLs, such as faceted pages, see parameter and faceted URL cleanup.
Need this implemented and verified? Request a quote.
Related reading
- noindex vs robots.txt vs 410Which removal method to use, and which one backfires.
- Staging and dev site cleanupGet test, staging and development copies out of search results.
- Parameter and faceted URL cleanupStop filter, sort and tracking URLs from bloating the index.
- Blocked by robots.txt but still indexedWhy Disallow does not remove URLs, and how to fix the trap.