To prevent images from appearing in Google search results, you can use robots.txt to block image URLs or set rules based on file extensions. You can also add X-Robots-Tag: noindex to an image’s HTTP response, but you must allow Google to crawl the image so it can read that directive. If the issue is simply that an older version of Webmaster Tools displays “jpg” as a keyword, that does not necessarily mean the images have been indexed: blocking image resources and excluding text from a report are different issues.
First, confirm whether you want to exclude images or the text “jpg”
The original discussion involved Joomla 1.5.9 with the Phoca gallery. The person asking the question said they had already blocked the gallery folder in robots.txt, but Google Webmaster Tools still displayed “jpg” as a recent keyword. Some participants also suggested that the actual goal was to exclude the text “jpg,” rather than the images.
This historical material does not establish why the keyword appeared, nor does it demonstrate that the blocking rules failed. If images are indeed the target, first check their actual URLs: are all JPG files in the blocked folder? If some images are stored elsewhere, the existing folder rule may not cover them.
Set rules for individual images, paths, or file extensions
Google’s official documentation provides examples with different blocking scopes. Each example below targets Googlebot-Image to exclude images from Google Images results; the two lines in each rule set must be entered on separate lines.
- A single image:
User-agent: Googlebot-Image
Disallow: /images/dogs.jpg - All image URLs ending in .jpg:
User-agent: Googlebot-Image
Disallow: /*.jpg$ - Images across the entire site:
User-agent: Googlebot-Image
Disallow: /
The official documentation also uses /*.gif$ to demonstrate how to exclude GIF images while keeping JPG images. To exclude images from all Google searches, rather than just image searches, use Googlebot as the user agent. This does not mean you can simply substitute that user agent in every rule: Disallow: / in the site-wide image example is used with Googlebot-Image.
noindex for an image is not the same as noimageindex for a page
A noimageindex directive on a web page can prevent images embedded on that page from being indexed. However, if the same image also appears on other pages, it may still be indexed through those pages. To prevent a specific image from being indexed regardless of which page references it, the official documentation recommends adding X-Robots-Tag: noindex to the image’s HTTP response headers.
When using this header, do not also use robots.txt to prevent Google from crawling that image URL, or it will be unable to retrieve the noindex directive. The official robots.txt example for a single image also explains that Google will see the rule the next time it crawls, so you should not expect the image to disappear immediately after you configure it.
Finally, exclusion from search is not access protection. robots.txt cannot stop other people from linking to images, and not all crawlers follow its rules. If images contain private information, use access restrictions such as password protection rather than relying solely on indexing controls.
Image indexing: perspectives from across the web
Does blocking JPG files also exclude JPEG images?
Not necessarily. When matching URLs by their file extensions, check .jpg and .jpeg image URLs separately; the Google example cited in the public discussion lists a separate Disallow rule for each. The rules must also cover the paths where the images are actually stored—you cannot determine this from the gallery page’s URL alone.
Why do images still appear in Google results after blocking rules have been set?
Start by checking whether robots.txt is in the site’s root directory and publicly accessible through a browser. Also confirm whether the actual image URLs fall within the rules’ scope. These are troubleshooting steps; the fact that images still appear in results is not enough to identify which setting, if any, is at fault.
Can disabling image hotlinking replace indexing controls?
It should not be treated as a direct substitute. Some discussions suggest disabling hotlinking to reduce other sites’ direct links to images and the opportunities for search engines to discover them. However, robots.txt itself cannot prevent others from linking to files. If the goal is to control search results, you still need to apply appropriate indexing controls to the image URLs.
Can you block all image resources to exclude images?
First assess whether the page depends on those images to be understood correctly. Google says that resources can be blocked with robots.txt if skipping them would not have a significant impact. However, if missing images would make it difficult for the crawler to understand the page’s content, blocking them could hinder its ability to analyze the page correctly.
References
- robots.txt 簡介與指南 | Google 搜尋中心 | Documentation | Google for Developersdevelopers.google.com — Discusses: Can disabling image hotlinking replace indexing controls?; Can you block all image resources to exclude images?
- 從 Google 搜尋中移除自己網站上的圖片 | Google 搜尋中心 | Documentation | Google for Developersdevelopers.google.com — Discusses: Why do images still appear in Google results after blocking rules have been set?
- Joomla + phoca SEO issueswebmasters.stackexchange.com — Source used in the article above.
- Joomla + phoca SEO issueswebmasters.stackexchange.com — Discusses: Does blocking JPG files also exclude JPEG images?; Why do images still appear in Google results after blocking rules have been set?
- Joomla + phoca SEO issueswebmasters.stackexchange.com — Source used in the article above.
- Joomla + phoca SEO issueswebmasters.stackexchange.com — Source used in the article above.



