Joomla Images and Robots.txt – Be Sure Google and Other Search Engines Can Index Them
By default Joomla’s robots.txt file includes a line to disallow search engines indexing your images folder. This means the images on your Joomla site will not be indexed in Google and other search engines Images results. Here’s how to allow images to be indexed.
What is the Robots.txt File
The robots.txt file which should be located in your website root folder provides search engines, and other “robots” what not to index and other instructions on your website. You can use it to specify select search engines and bots or all of them, and tell them what directories and files to index or not. For example, the following robots.txt file is for ALL search engines and bots (indicated with
User-agent: *) and states to “Disallow” indexing of the cgi-bin, images, tmp and private folders:-
Using the above code in the robots.txt file you can define what folders and files you want search engines and bots to index or not on your site. More information on the robots.txt file can be found here http://en.wikipedia.org/wiki/Robots_exclusion_standard.
How to Allow Images to Be Indexed
By default Joomla adds the
Disallow: /images/ line to the robotos.txt file which is very bad if your Joomla site is used as a photo gallery system. So to be sure your images are indexed, download the robots.txt file, edit it and delete this line, then save and re-upload. Without this line search engines and bots are free to index your images folder.
What About Images within Components like Virtuemart or a Photo Gallery System?
Some components may store their images within the component directory itself. The robots.txt file also disallows indexing of the components folder where the component images directory would be. So there is a little more work involved in allowing this… you have three main options:-
- Remove the Disallow: /components/ line, and re-insert Disallow: /each_componet_path/ except the directory where the images are. This is long winded, you may have many lines and have to add them in when you add new components
- Some components may allow you change the images directory, so see if you can change it to within the /images/ folder
- Some search engines, noticeably Google, allow to use the Allow: directive. So after all your Disallow’s, insert an Allow: line to the folder path where the component images are. Note: this will only work on some Search Engines like google that support it. But hey, Google is the most important right!