By the deindexpages.com editorial teamPublished Updated
PDFs rank, get linked and stay in the index long after the page that introduced them is gone. Because a PDF has no HTML head, the meta tag is not an option. You have three real choices: delete it, protect it, or send a noindex header.
Choose your approach
Goal
Method
File should disappear for everyone
Delete it and return 404 or 410
File must stay downloadable by those with the link, but not be searchable
X-Robots-Tag: noindex on the PDF response
File is confidential
Authentication, then delete or restrict; plus a temporary removal for speed
File was replaced by a newer version
301 from the old URL to the new file or page, or update in place at the same URL
Option 1: delete and return a 404 or 410
This is the cleanest outcome. Google's documentation on HTTP status codes says it does not use content from 4xx URLs and removes already-indexed ones. Read 404 vs 410 for details. After deletion:
Remove the file from the server or storage bucket, including any CDN copies. Purge the CDN.
Check curl -I https://example.com/files/old.pdf returns 404 or 410, not 200.
Remove links to the file from pages and the sitemap.
Do not block the path in robots.txt, so Google can see the error.
Use URL Inspection to request a recrawl.
Option 2: send an X-Robots-Tag noindex header
If the file has to remain accessible, serve it with the header. Google says X-Robots-Tag works for non-HTML files such as PDFs. See the X-Robots-Tag guide for server-specific code. Apache example:
<FilesMatch "\.pdf$">
Header set X-Robots-Tag "noindex"
</FilesMatch>
Apply to a single file by matching its name, or to a directory by placing the rule there. The PDF must remain crawlable; do not disallow it in robots.txt.
Option 3: protect behind authentication
For documents that should never have been public, use a login, signed URLs, or a private bucket. Googlebot cannot index what it cannot fetch. Combine with deletion of public copies.
Speed it up with a temporary removal
When exposure is urgent, hide the URL while the permanent fix is applied. In Search Console, open the Removals tool, create a new request for the exact PDF URL, and keep the permanent fix in place. The hide lasts about six months, according to Google, and the file itself is untouched.
Handling multiple copies and variants
Same PDF at several URLs. Common with CDNs, query strings and old paths. Fix each, or redirect all to one and then deal with it.
Hosted on another domain or bucket. The Removals tool needs the property of the host where the file lives. A PDF in a storage bucket on a different domain needs its own handling.
Linked from other sites. Links do not prevent removal, but they can cause the URL to keep appearing until the header or error is seen. They matter less once noindex or an error status is observed.
If a new version supersedes the old, keep the URL stable and overwrite the file where possible, so links and rankings carry over. If you must change the URL, 301 the old one to the new file or to a page that explains it. Google may take time to update the snippet; see cached and outdated content for options to speed that up.
Do not upload sensitive documents to public folders or web-accessible buckets.
Serve internal documents from authenticated paths.
Default a noindex header for file types that never need to be searchable, such as internal reports or invoices.
Audit public file directories periodically.
Set metadata (title, author) in PDFs before publishing. Search engines may use the document title in results, so scrub internal names.
Verification
After changes, check the live response with curl -I, inspect the URL in Search Console, and monitor the Page indexing report. For approach and expectations, see how to verify a page is deindexed.
Worked example
A company accidentally uploaded /wp-content/uploads/2026/q3-board-deck.pdf, and it shows up for a branded search. The steps: delete the file and purge the CDN; confirm a 404 with curl -I; file a temporary removal for the exact URL; remove the link from the post that referenced it; and search for a distinctive phrase from the deck to find other copies, such as an attachment page or an email archive on the same domain. Finally, review who has upload permission and whether sensitive documents should have been stored in a private location in the first place.
Frequently asked questions
Can I put a meta noindex tag in a PDF?
No. PDFs have no HTML head. Use the X-Robots-Tag HTTP header.
Will deleting a PDF remove it from Google?
Yes, after Google recrawls the URL and sees the 4xx status. Use the Removals tool to hide it sooner.
Does robots.txt remove a PDF?
No. A disallowed PDF can stay indexed without a description, and Google cannot see a noindex header on a blocked file.
How long does it take?
A temporary removal is often within a day; header or deletion effects depend on recrawl. See how long deindexing takes.