Fixing the Joomla error: "Googlebot cannot access CSS and JS files"

Joomla 1.5, 2.5 and Joomla 3 are all affected by this error and being contacted by Google with a message saying:

"Google systems have recently detected an issue with your homepage that affects how well our algorithms render and index your content. Specifically, Googlebot cannot access your JavaScript and/or CSS files because of restrictions in your robots.txt file. These files help Google understand that your website works properly so blocking access to these assets can result in suboptimal rankings."

This error is caused by the robots.txt file in Joomla installations, which blocks access to the Google Bot to certain key files. 

We can't simply give googlebot access to all files in Joomla, as this would cause Joomla system files to be displayed in Google search results - which if nothing else would be bad for SEO. 

The solution is to add the following to the top of your robots.txt file in the main file directory of your Joomla installation:

User-agent: Googlebot
Allow: *.css
Allow: *.js

In addition, if you are using Joomla 1.5 or 2.5, I'd suggest removing the line in robots.txt that says "Disallow: /images/" 

It is generally good for SEO to enable images to be indexed by Google bots. 

Recommended Client Management Program