How do I apply noindex to a PDF?

The Citead team, updated

In short. Serve the PDF with X-Robots-Tag: noindex and allow Googlebot to crawl it so Google can read the indexing instruction.

Definition: Applying noindex to a PDF means serving the file with the HTTP response header X-Robots-Tag: noindex, an indexing instruction sent alongside the file. As of October 2026, Google documents this method for excluding PDFs and other non-HTML resources from its search results, provided its crawler can access the resource.

Key facts

  • Google's X-Robots-Tag specification supports response headers for PDFs, videos and images.
  • Google's noindex documentation requires the resource to remain accessible to its crawler, including permission in robots.txt, the file that controls crawler access.
  • Google's URL Inspection help identifies Indexing allowed? as the field showing whether a URL explicitly disallows indexing.

Where does the instruction go?

The PDF's HTTP response carries this header:

X-Robots-Tag: noindex

Google's header specification describes adding it through the web server configuration. For a PDF, the configuration applies to the response serving the document. An HTML robots meta tag belongs to an HTML page; the PDF uses the response header.

These configurations adapt Google's examples to use only noindex. On Apache web servers, the following belongs in the site's root .htaccess or httpd.conf file:

<Files ~ "\.pdf$">
Header set X-Robots-Tag "noindex"
</Files>

On NGINX web servers, the corresponding rule belongs in the site's .conf file:

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

These patterns cover matching PDF files across the site. For a single document, the same documentation provides filename-specific Apache rules and exact-path NGINX rules, with unicorn.pdf as its example. The intended scope determines which configuration applies.

Why must the PDF remain crawlable?

Googlebot, Google's search crawler, needs to fetch the document to read its header. Google's noindex guidance explains that a robots.txt block can prevent that fetch. A blocked URL can still appear in results when other pages link to it.

For an already indexed PDF, removal follows Google's next crawl that reads the instruction. The same guidance says a revisit can take months, depending on the page's importance on the internet, and points to URL Inspection for requesting a recrawl. Keeping crawl access available lets Google read the exclusion instruction.

How is the configuration checked?

The delivered PDF response is the first check: it needs to contain X-Robots-Tag: noindex. Google's URL Inspection documentation then provides separate fields for checking Google's access and interpretation:

  • Crawl allowed? reports whether robots.txt permits access.
  • Page fetch reports whether Google retrieves the resource successfully.
  • Indexing allowed? reports whether the resource explicitly disallows indexing.

A robots.txt block makes Indexing allowed? show Yes, because Google cannot read the indexing instruction. That result therefore needs to be read alongside Crawl allowed?.

The same documentation distinguishes indexed data from the live test. After a configuration change, Test live URL checks the current response; the indexed view describes Google's stored information from its previous crawl.

FAQ

Can I put noindex in robots.txt?

Google's implementation guidance says it does not support noindex in robots.txt. For a PDF, use the HTTP response header and allow crawling.

Do I need to include nofollow?

noindex controls exclusion from search results. Google's rule definitions assign nofollow a separate instruction about following links; Google's combined server examples include both rules, while its basic header example uses noindex alone.

Sources

  1. Google Search Central, "Robots meta tag, data-nosnippet, and X-Robots-Tag specifications", updated 24 March 2026
  2. Google Search Central, "Block Search indexing with noindex", updated 10 December 2025
  3. Google Search Console Help, "URL Inspection tool", accessed 17 October 2026

Check how a page reads to answer engines. Open the GEO score analyzer

Test a page and see what to fix first

The analysis usually takes less than 10 seconds and needs no account.

400,000+ pages scored in the public benchmark