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

/ / 13 Comments

Overview: For the last some days many bloggers, website owners 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 an email and as an alert to 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 is 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 show the same warning message that it is not mobile friendly. As this may affect 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 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 the 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 to 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 the others user agents. Using Method 2 issue will be fixed only for GoogleBot. If in future Bing / Yahoo other bots also throw the 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 the Mobile-Friendly test. Here is 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.

Thank you for reading, pls keep visiting this blog and share this in your network. Also, I would love to hear your opinions down in the comments.

PS: If you found this content valuable and want to thank me? 👳 Buy Me a Coffee

Subscribe to our newsletter

Get the latest and greatest from Codepedia delivered straight to your inbox.


Post Comment

Your email address will not be published. Required fields are marked *

13 Comments