WebmasterID logoWebmasterID
Robots & crawl control

robots.txt for images

robots.txt can control how image crawlers like Googlebot-Image fetch your images. This page explains how to allow or disallow image crawling, the trade-off with Google Images visibility, and why blocking images for search is different from blocking pages.

Verified against primary sources

Targeting image crawlers

Google uses Googlebot-Image to crawl images for Google Images. To stop image crawling of a directory while leaving page crawling intact, target the image token:

User-agent: Googlebot-Image Disallow: /private-images/

Blocking Googlebot-Image on a path means those images will not be newly indexed for image search. Other image crawlers (for example Bing's) use their own tokens, so target each one you care about.

Blocking pages vs blocking images

Blocking the HTML page that embeds an image does not necessarily remove the image from image search if the image file itself remains crawlable elsewhere. Conversely, blocking the image file's directory is the direct way to keep that image out of image results.

For a single image you do not want indexed, you can also use an X-Robots-Tag: noindex HTTP header on the image response — that requires the crawler to fetch the image, so do not also Disallow it in robots.txt, or the header is never seen.

How it appears in analytics and logs

Image-crawler hits (for example Googlebot-Image) on a directory mean that path's images are being fetched for image indexing. Blocking the path stops new image indexing of it.

Diagnostic use case

Keep specific image directories out of image search, or stop unnecessary image crawling, without accidentally removing images you want to appear in Google Images.

What WebmasterID can help detect

WebmasterID distinguishes image crawlers like Googlebot-Image from page crawlers, so you can see whether image crawling matches your robots.txt intent.

Common mistakes

Privacy and accuracy notes

Image crawl rules concern your own files, not visitors. robots.txt is a request to compliant crawlers and does not secure private images — use authentication for that.

Related pages

Sources and verification notes

Last reviewed 2026-06-24. Facts are checked against primary/official sources where available; uncertain specifics are marked “Data not yet verified” rather than guessed.