Scope: staging, subdomains, directories
Removing Images, PDFs and Other Files From Google Search
Deindexing pages does not automatically deindex the files they embed or link. Images, PDFs and downloads are indexed as their own URLs and need their own handling.
Files are separate URLs
A PDF at /files/report.pdf or an image at /img/team.jpg has its own URL, and Google can index it independently of any page that embeds or links it. When you remove a site, files often remain because they sit on a different path, a CDN hostname or a media library with its own rules.
Choosing the method
| Goal | Method |
|---|---|
| Keep files from appearing, but still serve them | X-Robots-Tag: noindex on file responses |
| Files must be private | Authentication or signed, expiring URLs |
| Files are gone | 404 or 410 for each file URL |
| Hide a specific file quickly | Removals tool with the exact file URL |
| Keep images out of image search specifically | Server-level noindex header, or blocking the image crawler in robots.txt; see Google's image documentation for the current guidance |
Google's robots meta tag documentation states the X-Robots-Tag header suits non-HTML files like PDFs, videos and images, where a meta tag is not possible. That is the standard route for noindexing files.
Setting the header for file types
On NGINX, use a location block that matches extensions, and add add_header X-Robots-Tag "noindex" always;. On Apache, a FilesMatch block with Header set X-Robots-Tag "noindex" does the same, subject to mod_headers being enabled. On a CDN or object store, use a response header rule for the relevant path or bucket. Verify with curl -sI against a real file URL.
| File type | Typical pattern |
|---|---|
.pdf | |
| Images | .jpg, .jpeg, .png, .gif, .webp, .svg |
| Office documents | .docx, .xlsx, .pptx |
| Archives and data | .zip, .csv, .json |
| Media | .mp4, .mp3 |
Finding indexed files
- Search with
site:example.com filetype:pdf, and variations for other types. - Search image results for your domain or brand.
- Review the Page indexing report for file URLs.
- Check your media library for files that are published but not linked, because they can still be discovered.
- Search for a distinctive phrase from within the file text, since PDF text is indexed.
- Review CDN or storage hostnames, see alternate hostnames.
Using the Removals tool for files
You can submit exact file URLs in the temporary removal tool. According to Search Console Help it applies to a URL or image URL. As with pages, it lasts about six months, and the permanent signal must follow. If the file is hosted on a hostname you cannot verify, you cannot use it; rely on the header or removal of the file.
Sensitive documents
If a file contains personal data, credentials or confidential business information, treat it as an incident. Remove or protect the file immediately, then deal with search results. Google's removal guidance is clear that noindex only removes from Google Search and does not stop access. After you protect the file, request removal of the URL, and consider whether the information has been exposed long enough to require rotating credentials or notifying people as required by law or contract. We cannot give legal advice.
Image-specific considerations
- Images referenced by pages you have noindexed can still appear in image results if the image URLs are crawlable and indexable.
- Hotlinked images from other sites may remain in third-party pages.
- A CDN may serve images with long cache lifetimes, so purge caches after changes.
- Alternate sizes and parameterised URLs are separate URLs.
Verification
Run site: checks restricted by file type, spot-check with URL Inspection and review the Pages report. Allow time for recrawl: files are often crawled less frequently than pages.
Checklist
- Inventory of file hostnames and paths
- Header rule applied and tested on each type
- Sensitive files protected, not just noindexed
- Removals filed for visible file URLs
- robots.txt not blocking the files while relying on the header
- CDN cache purged
- Follow-up checks at one, three and six months
Example: an exposed spreadsheet
A staff member uploaded a spreadsheet to the media library for a colleague. The file was not linked anywhere, but a crawler found it through a directory listing. The team deleted the file, returned 410 for its URL, filed a single-URL removal, confirmed the directory index was disabled, and reviewed the rest of the uploads folder for similar files. They also reviewed whether the data required notifying anyone, which is a question for legal advice rather than for SEO.
Disable directory listings
Open directory listings let crawlers discover files that no page links to. Turn them off in the server configuration, and check that the setting applies to upload and media folders as well as the web root.
Do not forget thumbnails and derived copies
Many platforms generate resized copies of images, such as thumbnails and responsive variants, each with its own URL. Apply header rules to the folder or pattern that holds the derived files, not only the original uploads, and include them in your inventory.
Frequently asked questions
Does noindexing a page noindex its PDFs?
No. Each file URL has its own indexing state. Apply the header to the files.
Can I use a meta tag for a PDF?
No. Use the X-Robots-Tag header, as Google's documentation explains.
How do I stop images appearing in Google Images?
Use a noindex header on the images, or follow Google's current image guidance for blocking the image crawler. Verify the result.
Is blocking files in robots.txt enough?
It prevents crawling but can leave bare URLs listed. Use it only after the files have dropped out, or follow Google's image guidance.
Official sources
Keep reading
- Pillar: How to Deindex a Website From Google and Bing: The Complete Guide
- Alternate Hostnames, IP Addresses and CDN URLs That Keep Sites Indexed
- Site-Wide Noindex: How to Apply It to an Entire Website
- Noindex vs Password Protection vs 410: Which Method Should You Use?
- How to Confirm a Site Is Deindexed: site: Checks and Other Evidence