deindexwebsites.com

Core methods

Site-Wide Noindex: How to Apply It to an Entire Website

A site-wide noindex is the cleanest way to take a live website out of search while keeping it available to visitors. It only works if every URL carries the signal and crawlers are allowed to read it.

By the deindexwebsites.com editorial team · Updated

When a site-wide noindex is the right tool

Use it when the site must stay reachable but should not appear in search: an internal tool with public URLs, a members area you do not want listed, a client preview you cannot password-protect, or a site that is being wound down gradually. It is the wrong tool if the content is sensitive, because Google's documentation is clear that a noindex only removes the page from Google Search results, while users and crawlers that do not support noindex can still access it.

How Google reads the signal

Google supports two equivalent forms. A robots meta tag in the page's head, and the X-Robots-Tag HTTP response header. The robots meta tag documentation explains that the header suits non-HTML files such as PDFs and images, and that site-wide rules can be set in Apache or NGINX configuration. For a whole website the header is almost always the better choice: one rule, no template edits, and it covers every file type.

Two points decide success. First, the signal is only discovered when the URL is crawled, so deindexing happens on Google's recrawl schedule, not yours. Second, the crawler must be allowed to fetch the page. If robots.txt blocks crawling, Google never sees the rule.

Method 1: the X-Robots-Tag header

Set it at the web server, load balancer or CDN so it applies to everything.

PlatformWhereRule
NGINXserver blockadd_header X-Robots-Tag "noindex, nofollow" always;
Apache.htaccess or vhost (needs mod_headers)Header set X-Robots-Tag "noindex, nofollow"
CDN / edgeResponse header ruleAdd header X-Robots-Tag: noindex, nofollow on all paths
Static host with headers fileHost's headers configurationAdd the same header for /*

The always flag in NGINX matters: without it the header is not added to error responses. Use noindex alone if you still want links followed; add nofollow if you also want links on these pages ignored. Check your own stack's documentation for the exact syntax, because platforms differ.

Method 2: the meta tag

If you cannot change headers, add this inside the head of every page template:

<meta name="robots" content="noindex">

Edit the shared layout, not individual pages, and remember the less obvious templates: 404 pages, login pages, paginated archives, tag pages, AMP or print versions, and any pages generated by plugins. A meta tag cannot cover PDFs, images or other files; use the header for those.

Method 3: CMS toggles, and why to distrust them

Many CMS platforms have a "discourage search engines" switch. Treat it as a request that needs verification, not a guarantee. Some implementations add a meta tag, some alter robots.txt (which is the wrong mechanism, see below), and some only affect part of the output. Always inspect the live response yourself.

Deployment checklist

  • Signal added at server, CDN or template level
  • Confirmed on the homepage, an inner page, a 404 page and a non-HTML file
  • robots.txt does not disallow the site, so Google can read the noindex
  • Sitemap kept in place until the pages drop out (it prompts recrawls), then removed
  • All hostnames covered: www, non-www, http, https, subdomains
  • Removals tool used for anything that must vanish quickly
  • Reports checked weekly until the pages are gone

Testing the header

Fetch a page and read the response headers. With curl the command is curl -sI https://example.com/page and you are looking for an x-robots-tag line. Test several paths, including one that returns a 404, one under each subdomain and one file such as a PDF. Then use URL Inspection on a sample URL: the live test shows whether Google can fetch the page and whether indexing is allowed.

The robots.txt trap

The most common error is adding Disallow: / and calling it done. Google's robots.txt documentation describes it as a way to manage crawling, not a way to keep a page out of Google. A disallowed URL that is linked from elsewhere can still be indexed without its content, and a disallowed URL can never have its noindex read. Google also does not support a noindex line inside robots.txt. The sound order is: noindex live and crawlable, wait for the pages to drop out, and only then consider adding a robots.txt block if you want to stop crawl activity. See robots.txt mistakes.

Expect a gradual result

Pages with strong links or frequent crawling tend to be revisited sooner. Orphaned, deep or rarely updated URLs can take much longer. Submitting a sitemap that lists the noindexed URLs is a legitimate way to prompt recrawls while you wait, then you retire it. Use Search Console reports to see which URLs are flagged as excluded by noindex, which is exactly the status you want.

When to switch methods

If you discover the content is sensitive, stop relying on noindex and move it behind authentication (password protection). If the site is going away permanently, a 410 for the whole site is cleaner than leaving noindex pages online forever.

A worked example

Suppose an internal documentation site runs on NGINX behind a CDN and has been picked up by search. The team adds the header at the origin, purges the CDN, and runs three checks: the homepage, a deep article and a PDF. All three show the header. They leave robots.txt permissive, keep the sitemap, and file a prefix removal for the main hostname. Two weeks later the Pages report shows most URLs under the noindex exclusion reason, and a handful of orphaned PDFs still indexed. Those PDFs turn out to live on a separate storage hostname that never got the header. Adding the rule there, and a removal request on that property, finishes the job.

The lesson is general: the header works, but only where it is deployed. Every hostname and file type needs its own test.

Choosing noindex, follow or nofollow

DirectiveEffectWhen to use
noindexDo not show the page in resultsAlways, for deindexing
noindex, nofollowAlso ignore links on the pageStaging and private areas
noneShorthand for bothSame as above

Frequently asked questions

How long until a noindexed site disappears from Google?

It depends on when each URL is recrawled. Google gives no fixed timeline. Use temporary removals for anything urgent.

Should I use noindex or nofollow?

Noindex is the deindexing signal. Add nofollow only if you also want the links on those pages ignored.

Will noindex stop AI crawlers or other bots?

Not necessarily. Noindex is a search-index directive. Other crawlers may not honour it, which is why sensitive content belongs behind authentication.

Can I noindex only part of the site?

Yes, apply the header to a path pattern, as covered in removing a directory.

Official sources

Keep reading