Protect Your Photos From Search Engines
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:
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
Locate where your photos are residing. This is as simple as clicking on one of your published pictures and grabbing the link: http://afterbedtimeblog.com/wp-content/uploads//Fotolia_38861998_Subscription_XL.png
this shows that my photo Fotolia_38861998_Subscription_XL.png resides in this folder: /wp-content/uploads/
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:
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 – Fotolia.com and © higyou – Fotolia.com