Free SEO extension ๐Ÿ”ฅ
Technical SEO โ€ข SeoSpidie Editorial Team โ€ข โ€ข 14 views

Robots Meta Tag vs X-Robots-Tag: Differences and When to Use Each

Two ways to give search engines indexing instructions, and when each is the right choice.

Bulk indexability checker illustration

Search engines accept page-level instructions โ€” "do not index this", "do not show a snippet", "do not follow links" โ€” in two places: a meta tag inside the HTML, or an HTTP header sent by the server. They support the same directives but suit different situations.

The robots meta tag

Placed in the HTML head, for example <meta name="robots" content="noindex, follow">.

  • Easy to set per page in most CMSs and SEO plugins.
  • Visible in the page source.
  • Only works for HTML pages.
  • You can target one crawler: name="googlebot".

The X-Robots-Tag header

Sent in the HTTP response, for example X-Robots-Tag: noindex.

  • Works for any file type: PDFs, images, videos, spreadsheets.
  • Can be applied to whole folders or file types with server rules.
  • Invisible in the page source โ€” easy to forget, and easy to apply by mistake.

Common directives

  • noindex โ€” do not show this in search results.
  • nofollow โ€” do not follow links on this page.
  • nosnippet โ€” no text snippet or video preview.
  • max-snippet:[number] โ€” limit snippet length.
  • max-image-preview:large โ€” allow large image previews (useful for Discover).
  • noimageindex โ€” do not index images on the page.
  • unavailable_after:[date] โ€” stop showing after a date.

When to use each

  • Normal pages: meta tag.
  • PDFs and other files: X-Robots-Tag.
  • Whole sections or staging sites: header rules at the server โ€” but password protection is safer for staging.

Important rules

  • Crawlers must be able to fetch a page to see either instruction โ€” do not also block it in robots.txt. See noindex vs disallow.
  • If both exist with different values, search engines generally apply the most restrictive.
  • Check after migrations and server changes โ€” headers often get copied by accident. Read excluded by noindex tag fix.

Check both quickly

The bulk indexability checker shows the meta robots value and the X-Robots-Tag header for many URLs at once, so hidden header problems stand out.

A worked example

A US university department had hundreds of outdated PDF brochures appearing in search. Editing each PDF was impossible, so the web team added an X-Robots-Tag noindex header for PDFs in the old brochures folder only. The outdated files dropped out of results over the following weeks, while current PDFs elsewhere stayed indexed.

Where mistakes usually hide

  • Server rules copied from a staging site that add noindex to everything.
  • CDN or security settings adding headers to whole folders.
  • Plugins that noindex categories, tags or media pages by default.
  • PDF folders with blanket rules that also catch important documents.

After any hosting, CDN or plugin change, check a sample of key URLs for both the tag and the header.

More free tools: browse all our free SEO tools, no sign-up needed.

Frequently asked questions

Can I noindex a PDF?

Yes, with an X-Robots-Tag header, since PDFs have no HTML head.

Which wins if meta and header conflict?

Search engines generally follow the more restrictive instruction.

Does nofollow in the meta tag stop crawling?

It asks crawlers not to follow links on the page; it does not block the page itself.

How do I see the X-Robots-Tag header?

Use a header checker, browser developer tools or an indexability tool.