X-Robots-Tag, n.

What is the X-Robots-Tag header?

An HTTP response header that carries robots directives such as noindex, so they can apply to PDFs, images and other non-HTML files.

Filed under crawling and indexing in the SEO glossary

Try the free seo checker

What the X-Robots-Tag header is

X-Robots-Tag is an HTTP response header that accepts the same directives as the meta robots tag, such as noindex, nofollow and nosnippet. Because it lives in the HTTP response rather than in HTML, it works for any file type.

You can also aim it at one crawler, for example X-Robots-Tag: googlebot: noindex.

When to use it

Use the header for files that cannot contain a meta tag: PDFs, Word documents, images and feeds. It is also handy for applying a rule to a whole folder or file type in server configuration, for example noindexing every PDF, or for keeping an entire staging host out of search engines.

Common mistakes

Staging configuration that sends X-Robots-Tag: noindex sometimes ships to production and quietly removes a site from Google; the header is invisible in the page source, so check the response headers after every deploy. As with any noindex, the URL must not be blocked in robots.txt or the crawler never sees the header.

Example

Noindex every PDF:

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

# Apache
<FilesMatch "\.pdf$">
    Header set X-Robots-Tag "noindex, nofollow"
</FilesMatch>
Check it on your site: SEO checkerScore any page against 35 on-page, technical and performance checks. Free, no signup.
Questions

Frequently asked questions

How do I check the X-Robots-Tag of a page?

Look at the response headers in your browser DevTools Network tab, run curl -I on the URL, or use an SEO checker that reports indexability.

Which wins, X-Robots-Tag or the meta robots tag?

Neither overrides the other. Search engines combine both and apply the most restrictive directive.

Does X-Robots-Tag work for images?

Yes. A noindex header on an image file keeps that image out of Google Images.

Related terms

Keep learning

Full SEO glossary

More free tools

Check the rest of your SEO

All free SEO tools

Find every issue like this across your site

Fix it automatically, then see what the fix earned.

  • The AI drafts the fix for every issue like this across your site, ranked by impact
  • Approve it and the free WordPress plugin publishes it, with one-click undo
  • 28 days later, the clicks each fix earned, from your own Search Console
Fix my site free Free plan, no card · not on WordPress? Copy each fix in