Fix : Googlebot cannot access CSS and JS files [WNC-658001]

14
Our Reader Score
[Total: 0 Average: 0]

Overview: From last some days many blogger, website owner are getting an alert warning message from google webmaster that Googlebot cannot access CSS and JS files on YourSitename.  This new warning send by both as email and as an alert into your webmaster (Google search Console).

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.

Check below Screenshot same I received from Google:

Fig 1

Googlebot cannot access CSS and JS files [WNC-658001] email from google


Then I checked PageSpeed Insights:

From Google PageSpeed Insights I got this message that This page may not pass Google's Mobile-Friendly Test. This might be because Google has updated his algorithm so Googlebot are not able to access CSS and JS files for my website.

Fig 2Google Page insight gives error


Then I checked for Mobile friendly:

Sad to know that both shows same warning message that its not mobile friendly. As this may effect on page ranking so I have to solve this as soon as possible.

google bot not access CSS and JS file , check robots.txt

 


How to fix this error .i.e Making Googlebot to access CSS and JS files.

Go and check your Robots.txt file. You need to edit your robots.txt file. This error occurs due to blocking in robots.txt file.

Previously this how my Robots.txt look:

User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
Disallow: /wp-content/plugins/
Disallow: /wp-content/themes/

 

Method 1 :
I just change the permission set allow property for plugin and themes and this solves my problem.

My final robots.txt look like

User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/
allow: /wp-content/plugins/
allow: /wp-content/themes/


Method 2 :-

Here we just give permission for Googlebot and disallow for others user agent. Using Method 2 issue will be fixed only for GoogleBot. If in future Bing / Yahoo other bot also throws same error then just apply method 1

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

# Other bot spider
User-agent: *
Disallow: /wp-admin/
Disallow: /wp-includes/


After editing my Robots.txt file I again went to check Mobile Friendly test.

Here the result. Mobile Friendly get, Googblebot able to access CSS and JS file
Finally  Happy to get it back 🙂
Hope you all have also solved this issue.

Hope you enjoyed this tutorial. If you have any recommendations, please let us know what you think in the comment section below! See you again next time!

If You Liked It, could you do me a favour and tell your friends !! By sharing it on Facebook, Google+ or Twitter.

 

 


Get your Printable Copy

14 COMMENTS

  1. Hi very informative article, i too got the message from google that 16 urls are blocked and need to unblock the resources. so when i seen the error i found it is blocking from wp-admin. now my question is can i allow wp-admin for google and keep disallow wp-admin for other search bots. can you suggest me what to do . if i allow wp-admin there will be any secuity issues about my website . need your suggestion

    • Hi sreeni,

      In robots.txt allowing to wp-admin is not good practise, as this helps to bad bots. But you can add this piece in your robots.txt to overcome with this issue User-agent: *
      Disallow: /wp-admin/

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

  2. Googlebot cannot access CSS and JS files
    So I’ve received the above message 8 days ago, and also the following explanation ”
    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. ”

    When I look at Crawl Errors there hasn’t been errors in the past 2 months.
    When I use Fetch as Google, the robot.txt file can be accessed
    When I use the robots.txt Tester, there are 0 Errors and 0 Warnings.

    As a layman, should I be concerned about this warning “Googlebot cannot access CSS and JS files on http://w3eagles.com/

    Or does it just happen sometimes, and fixes itself?

    It looks okay to me, but what should I do?

    Thanks in advance for your help.

  3. To day I go to Google Webmaster Tool and I got this message: Googlebot cannot access CSS and JS files on http://leafmulcherhq.com/ I fixed by adding this code to robots.txt Allow: *.css
    Allow: *.js ==> Then I check GWT but the I just see the same message. Please tell me how long this issuse is resolved. Thank you.

    • Hi jenny,
      I just checked robots.txt file of leafmulcherhq.com and I didn’t find `Allow: *.css Allow: *.js` on it. How you have updated your Robots.txt file ?? Also, if you have installed any cache plugin then do Empty Cache and check on GWT. This will sure solve it.

    • Hi Craig Riley,
      Your robots.txt file looks fine, but in Google PageSpeed Insights it shows you need to work for mobile version here the ScreenShot of it. This is coz of images, as you are using WordPress, I would recommend to pls check this image optimization plugin WP Smush.it this will help to reduce image file sizes and improve performance

    • @kelly: I have logged into ControlPanel and edited my Robots.txt file. Then from Google Webmaster I checked for robots.txt file whether is updated or not.
      As I have added w3total cache plugin in my website, so by empty all cache its solved the issue. Checked on Google Webmaster with Robots.txt tester it shows updated version of your file

  4. Hi satinder, Easy steps very helpful, I have tried the things and its worked but for this particular url -http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js
    its still blocking the script, Any suggestion on this how to fix. Thanks

LEAVE A REPLY