Mobile app version of vmapp.org
Login or Join
Hamm4606531

: Prevent indexing of image or file I understand that you can do the following to generally prevent images or pages from getting indexed. Add to the page's meta section: <meta name="robots"

@Hamm4606531

Posted in: #BackgroundImage #Images #Indexing #RobotsTxt #SearchEngines

I understand that you can do the following to generally prevent images or pages from getting indexed.

Add to the page's meta section:

<meta name="robots" content="noindex" />


Edit the robots.txt file:

User-agent: *
Disallow: /images/

User-agent: *
Disallow: /$folder/whatever.jpg

User-agent: *
Disallow: /$folder/*.gif$

User-agent: Googlebot-Image
Disallow: /$folder/*.gif$


Say you have a page which is indexed and you have an image referenced in a stylesheet (background image, whatever) or an image in an ordinary img tag,

<img src="/$folder/img.gif" alt="whatever title="yadda" />


So, according to the robots.txt the folder or specific image should not be indexed, however, the page is indexed (no no-index).

Will the search engines, in specific Googlebot-Image, honor the request? Index the page to the exclusion of the image in an img tag?

Will it also honor the request with regard to styled background images?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Hamm4606531

2 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

I believe X-Robots-Tag "noindex" is ideal for this case.


Header set X-Robots-Tag "noindex"


you can see examples of how to noindex png, jp(e)g, and gif files. That's specifically for an Apache .htaccess file. The implementation would be slightly different on other servers - but you get the idea.

If things are not yet indexed, you may also be able to fix the problem with a robots.txt block - but once they're indexed, you'll need to use a noindex to remove them.

10% popularity Vote Up Vote Down


 

@Ogunnowo487

Will the search engines, in specific Googlebot-Image, honor the request? Index the page to the exclusion of the image in an img tag?


Yes. Regardless of how the image is referenced on your site (img element, CSS background-image, etc.), if it is blocked by robots.txt then Googlebot-Image will be unable to crawl that image, which will most probably prevent that image being indexed and being returned in Google image search.

If pages are blocked from being crawled in robots.txt then they can still be indexed (and potentially returned in the SERPs) if other external pages link to them (although this is a URL only result - no title or description appears in the SERPs as the pages themselves have not been crawled). However, I have not seen a similar result with regards to images. If the image is blocked by robots.txt then it's not indexed.

You can also apply the same robots "meta tag" (specifically, the X-Robots-Tag HTTP response header in the case of non-HTML resources) to images as you can to pages if you want to, although this will generally be unconditional - applying to all bots and user agents.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme