Skip to content
FunnelGuard

Fix guide by FunnelsGuard

PDF noindexed by X-Robots-Tag header: how to find and fix it

SEO-041Low impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

Web pages can carry indexing instructions in their HTML, in a meta robots tag. Files such as PDFs, Word documents, images and spreadsheets have no HTML, so the only place to put the same instruction is the HTTP response header X-Robots-Tag. The header is sent by your server before the file itself.

Why it costs you leads or sales

When Google sees noindex, it removes the file from its results. Anyone searching for the exact brochure, datasheet or guide will not find it. Buyers who compare products often search for spec sheets and pricing PDFs, so a hidden file means a missed entry point to your funnel.

How a noindex header hides a PDF
  1. Server ruleAdds X-Robots-Tag: noindex to all .pdf files
  2. Google crawls PDFReads the header and obeys it
  3. PDF listed in searchNot shown for brochure or spec searches
  4. Visit and leadNo search visitor reaches the file or your CTA

The file works for people with the link, but search never lists it.

Monthly search visits to a brochure PDFExample numbers
Monthly search visits to a brochure PDF (example)Before header: 120 visits; After header (month 2): 15 visits; After fix (month 3): 95 visits046921201595Before headerAfter header (month 2)After fix (month 3)visits

Example: illustrative numbers for one PDF before and after a noindex header is added.

How to check if your site has it

Your browser does not show response headers on a PDF, so use one of these methods.

Check a file for a noindex header
  1. Request the headers with curl

    Run curl -I https://example.com/files/brochure.pdf in a terminal. Look for a line such as x-robots-tag: noindex. Header names are not case sensitive.

  2. Or use browser DevTools

    Open DevTools, go to the Network tab, load the PDF URL, click the request and read Response Headers.

  3. Use Search Console

    Paste the PDF URL into URL Inspection. If the page is excluded, the report may say 'Excluded by noindex tag' or show the header under the live test's page details.

  4. Check the Pages report

    In Search Console, open Indexing > Pages and look at 'Excluded by noindex tag'. Filter for URLs ending in .pdf or other file types.

  5. Test other file types

    Repeat for .docx, .xlsx, .pptx and image files you want found. A rule often targets a pattern that covers more than PDFs.

Example curl output with the problembash
$ curl -I https://example.com/files/brochure.pdf
HTTP/2 200
content-type: application/pdf
x-robots-tag: noindex, nofollow

How to fix it

First decide which files should be indexed. Some documents, such as private contracts or gated downloads, should stay noindexed. Then find where the header is added. It usually comes from the web server config, a plugin, or a CDN rule.

Remove the header by platform
  1. Apache: find the rule

    Search .htaccess and the site config for X-Robots-Tag. A typical culprit is <FilesMatch "\.(pdf|docx)$"> Header set X-Robots-Tag "noindex" </FilesMatch>.

  2. Apache: remove or narrow it

    Delete the block, or limit it to a private folder only. Reload Apache if you edited the main config.

  3. Nginx: find the rule

    Search your server and location blocks for add_header X-Robots-Tag. Remove it or move it into a location that only matches private paths, then run nginx -t and reload.

  4. Check includes

    Headers can be set in included files, so search the whole config directory, not just one file.

Apache: noindex only a private folder, not every PDFhtaccess
# Remove this broad rule:
# <FilesMatch "\.pdf$">
#   Header set X-Robots-Tag "noindex"
# </FilesMatch>

# Keep noindex only for a private folder (put this .htaccess inside /private/):
<IfModule mod_headers.c>
  Header set X-Robots-Tag "noindex"
</IfModule>
Nginx: noindex only a private locationnginx
# Remove a broad rule like:
# location ~* \.pdf$ { add_header X-Robots-Tag "noindex"; }

location /private/ {
  add_header X-Robots-Tag "noindex";
}
Header on public PDFs

Before

  • Every .pdf gets X-Robots-Tag: noindex
  • Brochures and spec sheets missing from search
  • Search Console lists them as excluded by noindex

After

  • Only private files carry noindex
  • Public PDFs return no X-Robots-Tag header
  • PDFs can be crawled, indexed and found

How to confirm it's fixed

Confirm the header is gone
  1. Re-run curl

    Run curl -I on the PDF again. There should be no x-robots-tag: noindex line. Test with and without a trailing cache by also adding a query string such as ?v=2.

  2. Purge caches

    Clear your CDN and server cache so the old header is not served from a stored copy.

  3. Run a live test

    In Search Console URL Inspection, run Test Live URL and check that indexing is allowed.

  4. Request indexing

    Click Request Indexing for your most important files. Others will be picked up as Google recrawls, which can take days to weeks.

  5. Search for the file

    Later, search site:example.com filetype:pdf to see which PDFs are listed.

How to prevent it happening again

Habits that stop it coming back
  • Write server header rules for specific private folders, never for whole file types.
  • Keep a list of the PDFs and files that should rank, and re-check their headers after server, CDN or plugin changes.
  • Review .htaccess, Nginx and CDN header rules after migrations and host changes.
  • Check Search Console's 'Excluded by noindex tag' report monthly for file URLs.
  • Use a staging site for header changes and test with curl -I before going live.
  • Put gated or private downloads behind a login, not just a noindex header.

How FunnelGuard handles this

FunnelGuard does not check this yet. Reading the response headers of PDFs and other non-HTML files is a possible future check, but it is not part of the product today.

What FunnelGuard does do is run your real customer journeys on a schedule, such as lead forms, checkouts and booking buttons, from the EU or the US. It checks each step, the tracking hits sent to ad and analytics platforms, and whether test leads reach your inbox and CRM. If a journey breaks, a failure is re-checked from a second region and you get one alert with a screenshot and a likely cause. That helps if a lead magnet download step stops working, but it will not tell you a PDF has a noindex header.

Questions people ask

Why is my PDF not showing up in Google search?

A common cause is an X-Robots-Tag: noindex HTTP header sent with the file. Other causes include a robots.txt block, no links to the file, or the file being new. Check the headers with curl -I and the URL in Search Console's URL Inspection.

How do I check if a PDF has a noindex header?

Run curl -I followed by the PDF URL and look for an x-robots-tag line containing noindex. You can also open DevTools, go to the Network tab, load the PDF and read its response headers. Search Console's URL Inspection also reports if noindex blocks indexing.

Can you put a noindex meta tag in a PDF?

No. PDFs have no HTML head, so a meta robots tag does not work. For non-HTML files, the way to send noindex is the X-Robots-Tag HTTP header from your server.

How do I remove X-Robots-Tag noindex from PDFs in Apache or Nginx?

Find the Header set X-Robots-Tag line in Apache or the add_header X-Robots-Tag line in Nginx, then delete it or limit it to private paths. Reload the server, clear any CDN cache, and test again with curl -I.

Should PDFs be indexed by Google?

Yes, if they are public content you want people to find, such as brochures, guides and spec sheets. Keep private or gated files out of search with a login, and use noindex only for files that are public but should not be listed.

How long does it take for a PDF to come back in Google after removing noindex?

It depends on how often Google recrawls the file. It can take a few days to several weeks. You can speed it up by requesting indexing in Search Console and linking to the PDF from pages Google already crawls.

Does FunnelGuard check for noindex headers on PDFs?

No, not yet. It is a possible future check. For now, use curl -I and Search Console to watch for it.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.