Protect Your Photos From Search Engines

If you’ve been wondering how to keep Google and the other SEs from indexing every bloody thing on your site, especially your images, this post is for you.

When one of my fav bloggers, Jessica, from MommyHoodNextRight, mentioned not wanting Google to index her images, I went to work searching for the perfect plugin.

It doesn’t exist. Well, no free one as far as I can tell. i tried a few on one of my subdomains and they just slowed things down.

But there is still a semi-simple way to stop Google or any SE from indexing your images.

I use this tactic to keep search engines out of my plugins folders. Seriously. I hadn’t originally realized SEs were indexing everything, I always thought it was just my posts and pictures and outbound links. Then I learned better. Keeping the SEs out of your plugins folder is something every self hosted blogger on WordPress should implement. And I used something as simple as …

A robots.txt file.

The Robots.txt is used to tell search engine crawlers which URLs it should NOT request when crawling a Web site. Most search engine crawlers usually look for this file and follow the instructions in it.

I created one when I moved to WordPress Self Hosting and have been updating it every now and then depending on what search engine spam bots I came across and wanted to block from my blog.

Then a few months ago I removed a plugin and within days I had 100 crawl errors because the urls for those plugins had been indexed by Google and now the urls were considered broken links. Bitch slapped my alexa.

Not wanting to go through the hassle of redirecting links for something as silly as that ever again, I snooped around the www and found that I could block SEs from just about anywhere on my site that I wanted to using my robots.txt file.

Here’s what my robots.txt file looks like:

protect your images from google

You can definitely use it for you photos, but the first thing that came to my mind was using a plugin because frankly not everyone likes playing in their host’s cpanel and if done incorrectly you could block search engines from indexing your entire site. But don’t be afraid. With a bit of patience and the instructions below you can get it done.

Since I didn’t find a plugin I liked, I’m going to share how you can semi-easily do this. The upside is, it’s not another plugin to bog down your site.

Creating the robots.txt file

Step 1

Locate where your photos are residing. This is as simple as clicking on one of your published pictures and grabbing the link:

this shows that my photo Fotolia_38861998_Subscription_XL.png resides in this folder: /wp-content/uploads/

Step 2

Now this is super easy.

I came across this site when I was searching for plugins.

Also this site has a great section called “Why do I want a Robots.txt?” Be sure to check it out.

Again, super easy but I’ve included screenshots so you can see exactly:

Step 3

As the site says “Now, copy and paste this text into a blank text file called “robots.txt” (don’t forget the “s” on the end of “robots”) and put it in your root directory. Like all other files on your server, make sure its permissions are set so that visitors (such as search engines) can read it.”

So you’ll basically sign into your host panel, go to the File Manager and upload this file.

You can also create this file from within your File Manager by clicking New pasting the info in and saving as robots.txt.

SiteMap Plugin Precaution:

If you’re using a sitemap plugin:

have it write these Sitemap files:

Write a normal XML file (your filename)
Write a gzipped file (your filename + .gz)

and if your sitemap plugin gives you this option:
Add sitemap URL to the virtual robots.txt file. Turn it off.

I use the Google XML Sitemaps v3 for qTranslate plugin to create my sitemaps.

Including a sitemap url in your robots.txt file will inform search engine crawlers about URLs that you want it to crawl. Most spiders follow whatever the robots.txt file tells it to do.

I can’t guarantee you this tactic will affect all photos already indexed. However it will stop future photos from being indexed by search engines that honor the robots.txt file.

As of this writing, none of the back-end files I disallowed crawling of can be found in the search engine results.

And that’s it!

photocredit: composite of © yuriy – and © higyou –

Learn To SEO Your Posts In Minutes
Free SEO Training Video and Checklist when you become a subscriber to weekly updates.
– Posted in: SEO

20 Comments… add one

Leave a Comment

CommentLuv badge
Lisa May 10, 2012, 7:51 pm

Vanita, why would one not want it searchable? My curious mind wants to know :) Thanks. and you sure are right about NOT messing in the ugly cPanel. Not my favorite place either, thought it is good to know.
Lisa recently posted…Do You Get Hung Up On Technical Issues?My Profile

Vanita May 10, 2012, 10:35 pm

Jessica shares her beautiful and creative photography of her children so she asked on my other blog how to keep google from finding those images. Also, if you’re getting hits just for images, then your bounce rate will go up which can hurt your SERP and alexa rankings. if you’re titling the photos based on keywords in your post, then it can help you rank for those keywords. stripping out the meta data from stock photos (which is usually pretty descriptive of the image) helps too. but if you’re using words that describe the image, visitors may just be dropping by to grab that image. their visit won’t last long and your bounce rate will increase. it’s nice to see that you have lots of traffic. i just believe it’s better to know how much of that traffic is targeted traffic.

Mayura May 10, 2012, 8:35 pm

That’s cool and easy to use ;)

I’ve known how to edit robots.txt manually and Google Webmaster Tools helps generate them easily too. But this one has far more options. I did it for my friends as they don’t need to crawl their images on their website by Google as they start to appear on Google Image search and anyone can easily save it to their hard drive. However unless they have sensitive information, the reason would be we just love them and don’t want others to have them ;) You know what I mean – prohibit re-sharing.

However once we published on web, re-sharing starts eventhough we happy or not. When it comes to copying content, blocking site is just a one step for prevention. There are more ways to get them done.

Really informative article Vanita :) I like the robot.txt generator.

Mayura recently posted…Analyze Your Website Performance with Google PageSpeed OnlineMy Profile

Vanita May 10, 2012, 10:30 pm

Mayura, keep in mind, using the robots.txt file doesn’t protect your files from being copied/downloaded/stolen, etc. it just keeps it from being indexed. this way people won’t visit your site just for the images. there are plugins to block downloading, but there’s no point considering there are multiple ways to capture a screenshot.

Mayura May 11, 2012, 1:01 pm

Ohw yeppy dear… I get it what you mean :) It’s about indexing, yeah… My friends were interested in not showing their images on Google images search. They were websites and blogs with images all over the pages with quotes, funny and you know that kind of stuff. May be am just derived from topic but that’s what I meant ;)


Ann May 10, 2012, 8:37 pm

This is awesome free/valuable info for protecting images!!! Thanks Vanita! One little question… I do get a lot of image searches on my site but haven’t thus far been concerned. If I was to implement this would it hurt my SEO? I assume it would hurt my hit rate…
Ann recently posted…Dreams of DarwinMy Profile

Vanita May 10, 2012, 10:20 pm

Ann, take a look at your web master tools. if you find those searches are leading to ppl sticking around to be a reader, than don’t block it. but if you find it’s causing your bounce rate to be high, you can either block it with the robots.txt file or change the name of the file before uploading so it’s not something that contains keywords. i use WP Smush it! to strip meta data from the files (especially with stock images you’ll find photos carry extra info within the file that you don’t see unless you open the image in an editing software but is searchable) When I upload an image – and i have time – i change the name to something that includes the post’s keywords, this way i have more opportunities to rank for those keywords and be found by readers researching that topic.

Ann May 11, 2012, 8:41 am

Vanita, you are the BEST!!! I am going to definitely look into my bounce rate!
Ann recently posted…We have egg-citing news!My Profile

Vanita May 11, 2012, 8:51 am

thanks girl. be sure to review the visit time for those who visit via the photo’s link or google image search. if those entries are still sticking around, then the photos being searchable are a good thing!

Artchoo May 11, 2012, 11:43 am

This is a great tip that I never would have thought to look for. Of course, it will still be easy to grab images from our sites, but it’s nice to know you can at least protect from being found for the sole purpose of stealing your images. Thanks, V.
Artchoo recently posted…Use Google Art Project as a Teaching ToolMy Profile

Vanita May 11, 2012, 5:44 pm


Jessica May 11, 2012, 4:29 pm

Ohhhh. This is awesome, Vanita! Thank you so much!! I owe you a million dollars! I’ve always wanted to know how to do this! I’m going to try it this weekend! Fingers crossed I don’t mess up anything major!

PragmaticMom May 11, 2012, 4:40 pm

I think I am too much of a Luddite. This is way over my head.
PragmaticMom recently posted…Friday Find: Pedometer to Teach Kids Math and FitnessMy Profile

Vanita May 12, 2012, 12:36 am

no worries girl, you don’t need it! keep your photos searchable!

PragmaticMom May 31, 2012, 6:56 pm

Great tip. Thank you for the step by step instructions. I need those!
PragmaticMom recently posted…4th Grade Book Club: Graphic Novel, Smile, by Raina TelgemeierMy Profile

Cici November 10, 2012, 7:30 pm

Hi, just wondering, can you use this for blogspot? for your blogs?
where does the code go? thanks ..

vanitacyril November 11, 2012, 5:11 pm

Hi Cici, this post is for WordPress self hosted platform. I suggest checking out he has a lot of great info for those on the Blogger platform

bhavana January 4, 2014, 5:51 am


i am somewat confused….suppose i have some fotos in d drive.(in my pc).i have uploaded them to a website …and i dont want them to be seen in google search…what is the step by step proccedure in that….and after creating a robots txt file how an we upload it in the website??

i am dam confused

please make it clear


Vanita Cyril January 4, 2014, 6:15 am

bhavana, the instructions only apply to wordpress self hosted. if your site is on any other platform i can’t help you. that being said, once you adjust the robots.txt file using the info you create at, you can continue to upload as usual. the robots.txt file is telling google not to index your pictures in that folder (your existing uploads folder) that you indicated when creating the robots file. whether google decides to honor your request is up to them. those pictures that have been indexed will not disappear from search. new images are not suppose to be indexed.
Vanita Cyril recently posted…Google Plus for Entrepreneurs: How To Reach Your MarketMy Profile

Donna B. March 6, 2014, 1:53 am

Thanks, this is a good tip, Vanita. I had a robots.txt that didn’t work, because I kept writing /images/ instead of uploads! But it still didn’t stop the search engines. Wordpress has horrible forums, with so little help – I’m guess 5% of the questions — so I didn’t know to add the wp-content part until now!

Some people here asked why stop images from being indexed. It’s true, you will get more hits — I’m a cartoonist, so I’ve studied this. But ever since Google started to outright steal all images over a year ago, by displaying fullsize images in their image search, without even a warning about copyright, with just a very small link to the original page…well, that was it for many online sites.

For the last year I’ve used a special php that I won’t go into, to cover images on Google with another image of my website, but I’m going to do the robots thing now.

Also: the best plug-in ever on Wordpress for this is No Right Click Images. Love it!
Donna B. recently posted…How kids make money now.My Profile

Is your blog super slow? Speed up your website with MaxCDN and grab 25% off when you use coupon code: tsmama