Home/SEO/X-Robots-Tag Generator

X-Robots-Tag Generator

Apply noindex and snippet rules to PDFs, images and entire directories — as ready-to-paste config for eleven servers and platforms.

Free Browser-based No signup Copy-ready
Generator Settings
Prefixing the value with a bot name scopes the rule to that crawler only.
Directives
Generated Config ready
nginx.conf

      

How it works

1

Pick your target

File extensions, a directory, a single path, or the whole host.

2

Choose directives

noindex, nofollow, snippet limits, expiry — optionally scoped to one crawler.

3

Deploy and verify

Paste the config for your stack, then confirm with the curl command in the Verify tab.

When a header beats a meta tag

A meta robots tag only works inside an HTML document. The moment you need to control a PDF, a JPEG, an XML feed or a whole folder of generated files, the tag has nowhere to live — and X-Robots-Tag, sent as an HTTP response header, is the only mechanism that works.

Where it earns its keep

  • PDF whitepapers and price lists outranking the landing pages that should convert.
  • Staging or preview hosts — a single site-wide rule beats editing every template.
  • User-uploaded media you never want in Google Images.
  • Generated exports (.csv, .json) that leak internal data into search.
  • Legacy directories you cannot edit the markup of.

Operational gotchas

  • Nginx: add_header in a nested block silently drops every inherited header. Re-declare them.
  • Apache: needs mod_headers; without it the directive is a no-op.
  • CDNs: a cached response keeps its old headers until you purge.
  • robots.txt: blocking the URL prevents the header from ever being read — the same trap as meta robots.
  • Staging leaks: a host-wide noindex that ships to production is a catastrophic and very common outage.
You can send several X-Robots-Tag headers on one response — for example a generic rule plus googlebot: noindex. Google takes the union and applies the most restrictive result.

Frequently Asked Questions

View all FAQs
Can X-Robots-Tag noindex a PDF?
Yes. It is one of the main ways to send a noindex directive for a PDF because the PDF cannot contain an HTML robots meta tag.
Can I use X-Robots-Tag on HTML pages?
Yes. It works at the HTTP-header level and can be used with HTML responses too.
Is X-Robots-Tag the same as robots.txt?
No. Robots.txt mainly manages crawl access. X-Robots-Tag provides indexing and search-presentation directives in an HTTP response.
Can I target an entire directory?
Yes. Server configuration can apply the header to every response under a chosen path. Test the scope carefully.
Can multiple headers conflict?
Yes. Multiple applicable headers can be combined. Check the complete live response whenever indexing behavior is unexpected.
Is this generator free?
Yes. Select the target, directives and platform above, then copy or download the generated configuration.

X-Robots-Tag Generator – Control Indexing with HTTP Headers

Use the X-Robots-Tag Generator above to create HTTP-header indexing directives. Choose whether the rule should target specific file types, one directory, one exact path or your entire site, select the directives you need, then generate configuration for your server or hosting platform.

X-Robots-Tag is especially useful when you need to control indexing for resources that cannot contain an HTML robots meta tag, such as PDFs, images, video files, documents and generated downloads.

The tool creates ready-to-use rules for Nginx, Apache, Cloudflare Workers, Netlify and Vercel, plus the raw HTTP header to verify after deployment.

What Is an X-Robots-Tag?

X-Robots-Tag is an HTTP response header that tells compatible search engines how a URL may be indexed or presented in search results.

A simple response can contain:

X-Robots-Tag: noindex

That directive tells a supporting search crawler not to index the URL.

Unlike a robots meta tag, the instruction is delivered in the HTTP response rather than embedded inside HTML.

This makes X-Robots-Tag useful for both HTML and non-HTML resources.

When Should You Use X-Robots-Tag?

Use X-Robots-Tag when the indexing instruction belongs at the server or response level.

Common examples include:

  • PDF reports
  • Downloadable documents
  • Image files
  • Video files
  • CSV exports
  • Generated files
  • Entire directories
  • Groups of files sharing one extension
  • Responses controlled at a CDN or edge layer

For a normal HTML page where you control the <head>, a robots meta tag is often simpler.

For PDFs and other non-HTML files, X-Robots-Tag is normally the practical choice because those files cannot contain a standard HTML meta element.

How to Use This X-Robots-Tag Generator

Start by choosing what you want to target.

Select File types when the same rule should apply to extensions such as PDF, CSV or EPUB.

Select A directory when everything under one path should receive the rule.

Select One exact path when only a single resource should be affected.

Select Everything only when you intentionally want the response header applied broadly.

Next, choose the directives. For example, selecting noindex tells supporting search engines not to index matching resources.

Choose your platform and generate the configuration.

After deployment, verify the real HTTP response. The configuration file may look correct while the live server still returns a different result.

X-Robots-Tag vs Meta Robots Tag

Both can provide many of the same indexing directives, but they are delivered differently.

MethodWhere It AppearsBest Use
Meta robotsHTML pageNormal HTML pages
X-Robots-TagHTTP response headerPDFs, files, directories and server-level rules
robots.txtRoot text fileCrawl access rules

If you want to noindex a normal web page, use the Meta Robots Tag Generator.

If you want to noindex a PDF or apply a rule across many matching files, use X-Robots-Tag.

Do not confuse either method with robots.txt. A robots.txt disallow controls crawling. A noindex header controls indexing after the crawler can access the response.

How to Noindex a PDF

A PDF has no HTML <head>, so you cannot place a normal robots meta tag inside it.

Instead, configure the server to return:

X-Robots-Tag: noindex

with the PDF response.

You can target one PDF, one directory of PDFs or every PDF on the site.

This is useful for documents that need to remain publicly accessible but should not appear as standalone search results.

Examples might include downloadable print versions, duplicate reports or files intended only for users who reach them through another page.

Do not block the PDF in robots.txt if the search engine needs to crawl it and read the noindex response header.

Noindex vs Nofollow

noindex tells a supporting search engine not to index the URL.

nofollow tells it not to follow links associated with the resource or page.

They solve different problems.

If your only goal is removing a resource from search, noindex is usually the relevant directive.

Do not automatically add nofollow to every noindexed URL. A noindexed HTML document can still contain useful links that you may want crawlers to discover.

For many non-HTML files, nofollow may have little practical value because the file may not function like a normal linked HTML page.

What Does nosnippet Do?

nosnippet prevents Google from showing a text snippet or video preview for the URL in search results.

It is stronger than simply changing a meta description.

A meta description is content Google may choose for a snippet. The nosnippet directive restricts whether a snippet can be shown at all.

Use this only when you intentionally want to limit how content appears in search.

If your goal is simply to prevent indexing, use noindex.

What Is max-snippet?

max-snippet limits the number of characters Google may show as a text snippet.

For example:

max-snippet: 160

sets a maximum snippet length.

A value of 0 acts like nosnippet, while -1 means no explicit maximum.

This is a search-presentation control, not a guaranteed description length. Google still determines the exact snippet based on the query and available content.

What Is max-image-preview?

max-image-preview controls the permitted size of image previews for a page.

Typical values include:

  • none
  • standard
  • large

If visual search presentation matters, restricting image previews may reduce the visual footprint of your result.

Do not select a restrictive value just because it exists. Use it only when your content policy requires it.

What Is unavailable_after?

unavailable_after tells Google not to show a URL in search results after a specified date and time.

This can be useful for resources with a real expiration point, such as:

  • Event documents
  • Short-term offers
  • Time-limited listings
  • Temporary reports
  • Expired registration materials

Do not use it as a general freshness signal.

A page or file does not need to disappear from search simply because it is old. Use unavailable_after only when the content genuinely should stop appearing after a deadline.

Bot-Specific X-Robots-Tag Rules

X-Robots-Tag can optionally target a specific crawler token. Use bot-specific rules only when the policy genuinely differs by crawler; otherwise a generic header is simpler to audit.

Multiple X-Robots-Tag Headers

A response can contain more than one X-Robots-Tag header.

It can also contain multiple directives in one header.

Search engines can combine applicable rules, and restrictive directives can take precedence when instructions conflict.

For example, accidentally returning one header that permits normal indexing and another that includes noindex can still result in the URL being excluded.

This commonly happens when rules are added at several layers, such as the origin server, CMS, CDN or edge configuration. Inspect the final live response to find the real result.

How to Verify an X-Robots-Tag

Do not stop after copying the generated configuration.

Request the live URL and inspect its HTTP response headers.

You should see something similar to:

X-Robots-Tag: noindex

Confirm that:

  1. The correct URL returns the header.
  2. URLs outside the intended scope do not receive it.
  3. No second configuration adds conflicting directives.
  4. The crawler is allowed to request the URL if it needs to read noindex.
  5. CDN caching has not preserved an older response.

Verification is especially important after deploying regex or directory-wide rules.

X-Robots-Tag and robots.txt

A common technical SEO mistake is combining a robots.txt block with noindex and expecting both to work together.

For a search engine to process an X-Robots-Tag noindex directive, it must request the URL and receive the HTTP response.

If robots.txt prevents that crawl, the crawler may not see the header.

If your goal is removal from search while keeping the resource publicly accessible, allow crawling and return noindex.

Use robots.txt when your primary goal is crawl management — see the AI Crawler Robots.txt Generator.

Use X-Robots-Tag when your goal is indexing or search-presentation control.

Common X-Robots-Tag Mistakes

The biggest mistake is applying a broad rule to more files than intended.

Other common problems include:

  • Blocking the same URL in robots.txt before noindex can be read
  • Adding headers only to HTML error responses instead of the real file
  • Forgetting CDN or proxy configuration
  • Returning conflicting X-Robots-Tag headers
  • Using a file-extension regex that matches unintended URLs
  • Assuming a server config change is live without checking the response
  • Leaving unavailable_after rules active after a campaign changes

Generate narrowly, deploy carefully and verify the actual header. For canonicalizing duplicate URLs alongside these rules, see the Canonical Tag Generator.

Related searches

x-robots-tag generatorx-robots-tag noindexnoindex pdfnoindex headerx-robots-tag nginxx-robots-tag apachenoindex a directoryx-robots-tag vs meta robotsnoindex imageshttp header noindexx-robots-tag cloudflarex-robots-tag vercel netlify