Fix“Googlebot cannot access” Error

Error is sometimes a pain that can cost us hundreds of hours. You might have at some point used plugins or has implemented other tricks to improve your WordPress Installation Security. This will in turn lead to  “Googlebot cannot access CSS and JS files” Error in WordPress. Now you might have seen tips and tricks to fix it but may have not been too helpful. These warnings seen on Google webmaster tool have instruction to fix it too. But these instruction may not be applicable directly and are not an easy one to follow.  I will try to explain in simple words as to what are these errors, their implication and how to remove it.

What are these errors?

These error are thrown if google cannot access these files. Now you may wonder as to why google need these files? Since Google is constantly working on giving their search engine everything to put the best result in front of users. Now they want to test the website in aspects of usability and responsiveness. This is where they require the css and js files.

Normally the wordpress does not block these files but you may have accidentally done it for security. If Google cannot access your site file then it will not be indexed. It will ultimately lead to the degraded SEO performance.

Now lets see how we can see which files are blocked and how to locate them.

How to remove these errors?

Before moving on to solution we need to first clarify the problem and its location. You need to find which of these files are blocked.

Login to your Google webmaster tools and go to Crawl>> Fetch as Google. Click on Fetch and render button. Wait for some time for result to appear.

Once the result is fetched, a row will appear just below it. Click on it and a page will appear.  This page will show how the users will see your site and how the googles sees it.

Now you can find which of the files are blocked by looking under the blocked resources. Check out Google Index >> Blocked Resources. 

If you open each resources you will be able to find the location of the files. These files should normally be the css files or the js files used by theWordPress plugins or themes.

Now since we have clarified the problem and pointed the resources causing it. Now let’s move on to solution.

Solution to “Googlebot cannot access CSS and JS files” error in in WordPress

Now you will need access to robot.txt file of your site. This is located in the root directory of your site. This is the file which controls what google is allowed to see and and which are not.

You can connect to your site using any FTP Clients like filezilla or anything. You can even login to your cpanel and using the filemanager present there to browse and edit the file.

If by any chance you are using the yoast plugin you can edit the robot.txt file using it too. Just go to the admin area >> SEO >>Tools. You will see the section where the file content for robot.txt is placed.

Robot file wordpress

You can probably see that these directories are not allowed for google to visit.

Now you will need to allow the Google to those directory where your file resides. For examples if your blocked resource is
then you will need to allow the directory /wp-includes/js/ using robot.txt.

To do that it is fairly simple. You will need to add the below lines of codes in the robot.txt file

Allow: /wp-includes/js/

It will allow every resource residing inside the js folder to be accessed by google bot.

You can add any other folders if there are other resources blocked as shown in the webmaster tool.

Now again Fetch and compare the result from the webmaster tool. Do the same for other resources and you will be good with your site.

Thanks for reading out this article. We hope that you have found it helpful and easy to understand. If you feel anything missing or have any question, do not hesitate to shoot.


Join the discussion 9 Comments

  • Ben qua says:

    Exactly what i meeded in this time of distress.
    This is of great help to me. I owe you a beer.

    Thanks a lot mate.

  • Pneil says:

    This was so far the best explanation. Quick and easy to understand and very fair. I was running berseck after i noticed this error on my webmaster tool. I did everything possible but wasn’t helpful. But this has clearly made its point. Awesome.
    I am glad that i came across this tool

  • Coder-dev says:

    Me too was having the same problem. I thought this was WordPress problem but I now came to know that this is a problem related to chrome .
    Never thought that this was due to the browser . Thanks a lot for sharing this helpful piece of information appreciate it. cheers

  • Wordpress master says:

    What an excellent piece of investigation.
    Just write on the target. I am not sure how you got the idea that this could be a browser problem and not a wordPress problem . I tried solving this problem but I was looking all over the WordPress to find the exact location where the issue is happening. You just had the right place to look into and that’s an awesome thing . Thanks for your help and I have successfully solve my problem .

  • Mike fred says:

    Exactly what i needed to aolve the issue. Saved mya day. I owe you a beer mate.

  • Christopher says:

    When i look into the google webmaster tool , there are more than 50 files and they are not in one location so what should i do?
    Should i allow directory of all the files to be allowed in robot.txt?

    Thanks in advance for all your help!

Leave a Reply

Enter the Captcha * Time limit is exhausted. Please reload CAPTCHA.