A noindex directive tells search engines: you can visit this page, but don't include it in your results. It's one of the most useful controls you have, and one of the most dangerous, because a single line left on by mistake can remove a page (or a whole site) from Google.
Two ways to set noindex
The robots meta tag
Placed in the page's head:
<meta name="robots" content="noindex">You can target one crawler by name, for example <meta name="googlebot" content="noindex">.
The X-Robots-Tag header
Sent by the server as an HTTP header. This works for files that have no HTML head, such as PDFs and images:
X-Robots-Tag: noindexBoth are treated the same way. The header is easy to miss because it doesn't show in the page source, which is why checking with a tool matters.
When to use noindex
- Thank-you and order confirmation pages.
- Internal search results pages.
- Login, account and cart pages.
- Thin tag or archive pages that add nothing to search.
- Staging and test sites (better still, protect them with a password).
- Duplicate printer-friendly or campaign landing pages.