How to fix: Googlebot Cannot Access CSS and JS Files - JoomShaper

How to fix: Googlebot Cannot Access CSS and JS Files

01 August 2015
Hits 6,224
2 min read
How to fix: Googlebot Cannot Access CSS and JS Files

In last couple of days Google send mass notifications to webmasters about blocked CSS and JavaScript files in there webistes. It doesn't matter whether you're using a Joomla, WordPress, or another CMS. Here you will find short info what you should do.

If you have account in Google Webmaster Tools check your inbox. Did you get an email from Google saying Googlebot can’t access your CSS and JS files because of restrictions in your robots.txt file? Opss, you are not alone. Google explains that blocking these assets can lead to "suboptimal rankings" in Google because engine cannot fully understand your Web site. Blah Blah Blah, the true it's all about Google's new focus on responsive design. They new algorithms can discover responsive code, in both CSS and JS files, clever.

What is the solution?

  1. A new robots.txt.dist file is being distributed with the latest version of Joomla 3.4.x where the issue is fixed. Just rename robots.txt.dist into robots.txt and replace old file with new one.
  2. Then go to Google's Mobile-Friendly Test and check your site. This tester tool is very informative and points out the exact issue for this particular site.
  3. You can also use Google Webmaster Tool where there is a section (left menu) within Google Search Console called "Blocked Resources". It allows you to check all the pages on the site that have blocked resources.

The solution will depend on what template and extenstions you're using , there are some resources also "plugins" folder. You can make a test, remove "Disallow: /plugins/" from robots.txt then run online tester again.

But if you're conscious and responsible webmaster you can allow access to only seleted subfolders in plugins folder, not all. You need to allow certain plugins if they handle much of your content or template core like framework. Do this by adding the following line to your robots.txt file, instead of removing whole "Disallow: /plugins/" part. Example:

Allow: /plugins/system/example_plugin_name/plugin_assets/

Note! These updates require FTP access to your own server. 

As you unblock CSS and Javascript, you can submit the URL to be recrawled (from GWT) or simply just wait for Googlebot to do it on its own after while.

 

 

There are no comments posted here yet

Sign up for our newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.