The X-Robots-Tag is an HTTP response header that tells search engines whether to index a URL and how to show it, using the same rules as the robots meta tag. The difference is where it lives: the meta tag sits in a page’s HTML, the header travels with the server’s response, so it also works for PDFs, images, videos and any other file that has no HTML head.

Rule of thumb: use robots.txt to control crawling, use the meta tag or the X-Robots-Tag to control indexing and snippets. In 2026 the same snippet rules also decide how much of your content Google can show in AI Overviews and AI Mode.
What does it look like?
A server response with the header:
HTTP/1.1 200 OK Content-Type: application/pdf X-Robots-Tag: noindex, nofollow
You can also target one crawler by name:
X-Robots-Tag: googlebot: noindex X-Robots-Tag: bingbot: nosnippet
The rules you can use
| Rule | What it does |
|---|---|
noindex |
Keep the URL out of search results. |
nofollow |
Don’t follow the links on the page. |
nosnippet |
Show no text or video snippet. Google says this also keeps the content out of AI Overviews and AI Mode answers. |
max-snippet:[n] |
Limit the snippet to n characters. Also applies to AI features in Google Search. |
max-image-preview:[none|standard|large] |
Control image preview size. |
noimageindex |
Don’t index images on the page. |
unavailable_after:[date] |
Drop the URL from results after a date. |
indexifembedded |
Allow indexing when embedded in another page, even with noindex. |
Source: Google’s robots meta tag and X-Robots-Tag documentation. Tags you may see online such as noai or noimageai are not part of Google’s or Bing’s documented rules.
X-Robots-Tag vs. robots.txt vs. meta robots
| robots.txt | Meta robots | X-Robots-Tag | |
|---|---|---|---|
| Controls | Crawling | Indexing and snippets | Indexing and snippets |
| Works on PDFs and images | Yes (blocks the fetch) | No | Yes |
| Can apply to a whole folder | Yes | No, page by page | Yes, with a server rule |
| Where AI crawlers are named | Yes (GPTBot, OAI-SearchBot, ClaudeBot, Google-Extended) | Limited | Limited |
The classic mistake: blocking a URL in robots.txt and adding noindex to it. If Google can’t crawl the URL, it never sees the noindex, and the URL can still appear in results with no description. To remove something from the index, let it be crawled and send noindex. For AI crawlers, robots.txt is still the main switch (what is robots.txt).
How do you add it?
Apache (.htaccess), all PDFs:
<FilesMatch "\.pdf$"> Header set X-Robots-Tag "noindex, nofollow" </FilesMatch>
Nginx, all PDFs:
location ~* \.pdf$ {
add_header X-Robots-Tag "noindex, nofollow";
}
On WordPress, most SEO plugins set noindex for HTML pages through the meta tag. For files in the uploads folder you need a server rule like the ones above, or your host’s header settings.
A real case from our own site
Our October 2026 crawl of stradiji.com turned up a standalone HTML file in the uploads folder, an old 2024 infographic, crawlable and indexable as its own page. It has no WordPress editor, so there is no checkbox for noindex. This is exactly where the X-Robots-Tag earns its place: one server rule for that path, no file edits. It is on our fix list. When you audit a site, look for indexable files that live outside your CMS: PDFs, old HTML exports, staging copies.
How do you check a URL’s X-Robots-Tag?
- Terminal:
curl -I https://example.com/file.pdfand look for the X-Robots-Tag line. - Browser: DevTools, Network tab, click the request, Response Headers.
- Google Search Console: URL Inspection shows whether indexing is allowed and why not.
- At scale: Screaming Frog’s Directives tab lists every URL’s X-Robots-Tag next to its meta robots, which is how we audit client sites.
Free · 38 checks
Is your site ready for AI search?
Related terms
Frequently asked questions
What is the X-Robots-Tag used for?
To control indexing and snippets for any file a server returns, especially non-HTML files like PDFs and images, and to apply one rule to many URLs at once.
Can the X-Robots-Tag block ChatGPT or other AI crawlers?
Not reliably. AI companies document robots.txt user agents (GPTBot, OAI-SearchBot, ClaudeBot, PerplexityBot) as the control. In Google Search, nosnippet and max-snippet limit what appears in AI Overviews and AI Mode.
Does Google support the X-Robots-Tag?
Yes. Google treats it the same as the robots meta tag, and Bing supports it too.
Should I use the X-Robots-Tag or the meta robots tag?
For normal HTML pages the meta tag is easier to manage. Use the header for files without HTML, for whole folders, or when you can’t edit the page.
