Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Unwanted Google Indexing of all images in Gallery!

3 years 7 months ago #1

  • Marc's Avatar
  • Marc
  • Posts: 4
Hello All,

I have had quite some difficulty figuring out how to stop search engines (Google) from indexing ALL Gallery images once a website had been launched. In my case most pictures in the gallery are of 'people' and that can be sensitive content.

So for those of you who may actually want to block the indexing of all images I am sharing my solution (while most of you probably want all or most of your (lightbox) images indexed).

The main 'mistake' I made was to not be 'prepared' before submitting my website to Google.

In any case here is my solution for not having image links indexed!

I should have added this in robots.txt BEFORE submitting my website:

Disallow: /*?

This 'disallow' rule should stop Google from indexing all 'links' that have a "?" in it.

And in case you want your gallery page indexed (just the first page which loads with your "Gallery" Menu Button), then you can add this rule Allow: /gallery.html$ (I'm assuming your Gallery menu alias is called "gallery").

Disallow: /*?
Allow: /gallery.html$

The "$" tells Google that nothing comes after the .html

I have more than 5000 pictures in my (Album Mode) gallery, and due to my mistake I had to use Google's Webmaster Tools to try to remove 100-200 images per day, but new images were being indexed anyway even though I desperately added Disallow: /*? and also tried other codes in my robots.txt. Somehow Google continued to add image links.

So for those who were TOO LATE with the robots.txt like me, here is another tip:

Change the alias of tour Gallery Menu Button to something else, like main-gallery and make sure Disallow: /*? is in your robots.txt. Then you can let Google fetch and render main-gallery.html

And to get rid of all the undesired links (mentioned above) in google, in Webmasters Tools submit a directory removal of /gallery - this will successfully remove all indexed links of gallery.html and gallery.html?categorynames etc... the directory removal will look something like this in Webmasters Tools.

I'm curious if this will be helpful for anyone, and if there are further tips and suggestions ;=)
Powered by Kunena Forum