What Is the Meta Robots Tag?

The meta robots tag is an HTML directive that determines how a search engine bot indexes a single page and how it follows the links on that page. The <meta name="robots" content="..."> line added inside <head> gives Googlebot and other search engine bots page-specific instructions. For files that contain no HTML — images, PDFs and videos — the same job is done by the X-Robots-Tag HTTP header sent by the server.

This tag is typically used on pages you do not want to appear in search results: thank-you pages, duplicate URLs generated by filter and sort parameters, admin panels that require a login, or draft content not yet ready to publish. Used correctly, it helps the search engine direct its resources at the pages of your site that really matter.

Which Pages Should Use noindex?

Not every page needs to appear in search results; some pages are necessary for the visitor but gain nothing from being in the search index, and may even harm the site. Using noindex on pages like these helps the search engine reserve its resources for the pages of your site that genuinely create value.

  • Pages reached only after an action, such as order confirmation or thank-you pages.
  • Parameterised result pages produced by the internal search engine, such as ?q= URLs.
  • Product listing URLs spawned by filter and sort combinations that hold almost identical content.
  • Account, cart and admin panel pages that require a login.
  • Draft content not yet ready to publish, and duplicate pages in test/staging environments.

The Difference Between robots.txt and Meta Robots

robots.txt and the meta robots tag operate on two completely different layers. A Disallow rule in the robots.txt file prevents the bot from crawling the page; the bot never visits that URL at all. A meta robots tag containing noindex, by contrast, only works if the page has first been crawled: the bot visits the page, sees the noindex directive in the HTML, and only then decides to drop the page from the index.

That is why disallowing a page in robots.txt and adding noindex to it as well is a common mistake that defeats itself. Because the bot never crawls the page, it never sees the noindex tag inside it; if the page is linked from somewhere else, it can stay in the index regardless.

Meta Robots Directives: What Each One Does

Several comma-separated directives can be added to the content attribute. The most commonly used are:

DirectiveWhat it does
index / noindexDetermines whether the page appears in search results.
follow / nofollowDetermines whether <strong>all</strong> links on the page are followed.
noarchivePrevents Google from showing a cached/copy version of the page.
nosnippetPrevents a text or video preview from being shown in the search result.
noimageindexPrevents the images on the page from being indexed in Google Images.
notranslatePrevents Google from offering a translation of the page.
max-snippet:NSets the maximum character length of the preview text; <code>-1</code> means unlimited.

Directives can be combined. To drop a page from the index entirely and stop its links being followed, for example, you would write noindex, nofollow; to index the page but turn off the cached copy and image indexing, index, follow, noarchive, noimageindex.

The HTML Tag and the X-Robots-Tag HTTP Header

The standard usage is to add a line such as <meta name="robots" content="noindex, nofollow"> to the <head> section of the page. That line applies only to that page and does not affect the rest of the site.

For non-HTML files such as images, PDFs and videos, a <meta> tag cannot be used; in that case the same directives are sent server-side with the X-Robots-Tag HTTP header. Google Search Central officially supports this method and accepts the same directive syntax (index/noindex, follow/nofollow, noarchive, max-snippet and so on). To drop every PDF file from the index on an Nginx server, for example:

The same rule is applied on Apache inside .htaccess or a virtual host definition like this:

Common Mistakes

  • Disallowing a page in robots.txt while also adding noindex to it — because the bot never crawls the page, the tag is never seen.
  • A noindex tag left behind in a test or development environment being carried into production with the code, silently dropping the page from the index.
  • Trying to add a <meta> tag to non-HTML files such as PDFs — for those file types only the X-Robots-Tag header works.
  • Confusing the page-level nofollow directive with the rel="nofollow" attribute on an individual link.

Build the Tag With Our Tool

Instead of writing the directives by hand and risking a syntax error, you can pick the combination you want in the tool below and get both the HTML meta tag and the equivalent X-Robots-Tag HTTP header ready to use.