The Noindex Tag: Keep a Page Out of Google the Right Way

The noindex rule tells search engines not to show a page in their results. Put <meta name="robots" content="noindex"> in the page head, or send an X-Robots-Tag: noindex header for files like PDFs. The page must stay crawlable: if robots.txt blocks it, Google never sees the rule.

Meta robots tag or X-Robots-Tag header
Meta robots tagX-Robots-Tag header
Where it goesInside <head> of an HTML pageIn the server's HTTP response
Works forHTML pagesAny file: PDFs, images, HTML
Who can add itAnyone who can edit the pageNeeds server or host settings
Example<meta name="robots" content="noindex">X-Robots-Tag: noindex

Updated

Business sites usually need noindex for a few pages: thank-you pages after a form, internal search results, staging copies, and downloadable files meant only for customers. Tick the rules you want below and copy the meta tag, the header, or the Apache and Nginx lines that send it.

Noindex snippet builder

Which crawlers: All search engines (robots), Google only (googlebot)

Rules

  • noindex: Do not show this page in results
  • nofollow: Do not follow links on this page
  • nosnippet: No text snippet or video preview
  • noimageindex: Do not index images on this page
  • notranslate: Do not offer a translation in results

Stop showing after this date (optional)

Meta tag for the page head

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

HTTP response header

X-Robots-Tag: noindex

Apache (.htaccess), for PDF files

<Files ~ "\.pdf$">
  Header set X-Robots-Tag "noindex"
</Files>

Nginx, for PDF files

location ~* \.pdf$ {
  add_header X-Robots-Tag "noindex";
}

The server examples match PDF files; change the pattern to match the files you need.

Noindex in a React or Next.js page

Frameworks render the same meta tag. In the Next.js App Router, the metadata object has a robots field.

Next.js App Router metadata

Exported from a page or layout file; Next.js writes the robots meta tag into the head.

export const metadata = {
  robots: { index: false, follow: true },
};

Noindex and robots.txt do different jobs

robots.txt controls crawling: whether a bot may fetch a page at all. Noindex controls indexing: whether a fetched page may appear in results. Combining them on one page backfires, because the block stops Google from reading the noindex.

The order that works is to allow crawling, add noindex, wait for the page to drop out, and only then block it in robots.txt if you still want to save crawl visits.

Targeting one crawler

Swap robots for googlebot in the name attribute to address only Google. In the header form, put the crawler name and a colon before the rules, for example X-Robots-Tag: googlebot: nofollow.

How it works

  1. Choose whether the rule applies to all search engines or only to Google.
  2. Tick the rules you need. Noindex keeps the page out of results; the others limit links, snippets and images.
  3. Copy the meta tag into the page head, or the server lines into your host's configuration.
  4. Check that robots.txt does not block the page, then run URL Inspection to confirm Google sees the rule.

Tips

  • Remove the page from your XML sitemap when you noindex it. A sitemap says please index; noindex says do not.
  • Website builders often hide noindex behind a setting called hide from search engines or similar. Look there before editing code.
  • Check staging and preview sites. A noindex left on after launch is a common reason a whole new site never appears.
  • If a page must be private, use a password. Noindex hides it from results, not from people who have the link.

Frequently asked questions

Why is my noindexed page still in Google?

Either Google has not recrawled it yet, or robots.txt blocks it. Google's documentation says the page must not be blocked by robots.txt for noindex to work, because a blocked page is never fetched and the rule is never read.

What is the difference between noindex and nofollow?

Noindex keeps the page itself out of results. Nofollow asks crawlers not to follow the links on the page. The rule none is shorthand for both together.

Is the noindex tag case sensitive?

No. Google's robots meta tag documentation says the header, the user agent name and the values are not case sensitive.

Do other search engines respect noindex?

Google supports it fully. Its documentation notes that some other search engines may interpret the rule differently, so a page could still appear elsewhere.

What happens if two rules conflict?

Google applies the more restrictive one. Its example: if a page has both max-snippet:50 and nosnippet, nosnippet wins.

Related: Robots.txt generator, Sitemap and robots.txt examples, Robots.txt tester, Remove a URL from Google, Meta tag generator.

Build your site free or see all free tools. On We.Inc you can build your site free, with no card and no trial needed to start. AI building is on paid plans from $19 a month.

More in Guides

Product

Who It's For

Features

Resources

Company

View Sitemap