How To Fix Googlebot Cannot Access CSS & JS Warning

Fix Googlebot Cannot Access CSS JS Warning
  • Save

Have you received a warning from Google Search console team saying “Googlebot cannot access CSS and JS files on”?

If your answer is yes, here is how you can fix the warning. If your answer is no, you are about to receive such email soon.efore we do that, let me explain why you and many other webmasters got this warning.

Here is how my warning email from Google team looks like:

Googlebot cannot access CSS and JS files
  • Save

If you haven’t received this warning email yet, instead of waiting for the email, you can take action right away.

I suggest you to login to your Google search console tool here, & go to your site dashboard. Click on Google Index > Blocked resources & see is search console is showing any blocked resources for your site.

blocked resources in Google Webmaster tool
  • Save

You can click on the domain name under Host column, which will show which all specific files are blocked for search engine bots for crawling. If you see only those entries that are intentionally blocked by you for better crawling, then you don’t have to worry about anything.

But if you see files such as theme or plugins .css & .js files which is essential for site display, you need to edit your website/blog robots.txt file. This is applicable for almost all WordPress blogs & few other popular CMS.

blocked js css files Google
  • Save

Before I show you how to fix this issue, here is a tip for those who have submitted their site to search console just after reading this. (Easy to follow Tutorial here)

Chances are you might not see any blocked resources for your site right away, so you can use Fetch as Google feature.

Fetch as Google
  • Save

Click on Crawl > Fetch as Google to add a fetch & render request that will be completed in few seconds. After that click under status to see how Google sees (Render) your site. In the below screenshot, you can see how Google view is different that a reader view for ShoutMeLoud. (Which I have fixed  & shared the steps below).

Google rendering
  • Save

This is where things get interesting as you can click on robots.txt tester to further see which line of your robots.txt file is blocking the bots from accessing your site CSS & JS file. In my case Disallow: /wp-includes/ was the culprit.

Blocked Robots txt file
  • Save

If your result is something like the same, here is how you can fix it. My guide is targeted for WordPress platform, but the process is similar for any other platform including custom CMS. BlogSpot users can learn here on editing robots.txt file on their platform.

How to fix CSS & JS Warning by editing robots.txt?

If the terms like robots.txt sounds new to you, don’t worry as you are not alone. It’s a common lingo in the SEO industry but not so popular among bloggers. Here we have two guides that will give you essential learning about it & they are not boring.

I suggest you to read it, as it will give you a great insight on a big aspect of search engine optimization. For WordPress blog, you can edit your robots.txt file using FTP click such as FileZilla or use the file editor feature of SEO by Yoast.

Yoast SEO plugin let you edit your robots.txt & .htaccess file from the WordPress dashboard. I have already talked about this earlier in this setup guide. I have also highlighted this step below.

Here is how you can access robots.txt file & edit it from your WordPress dashboard.

Inside your WordPress dashboard, click on SEO > Tools & click on file editor

Yoast File editor
  • Save

On this page, you can view & edit your robots.txt file. In the majority of cases, you need to remove following line:

Disallow: /wp-includes/

Depending upon how you have configured your robots.txt file, it will fix most of the warnings

Fixed Disallow- :wp-includes:
  • Save

As I mentioned above, Google search console tool is giving enough data for any non-SEO or a basic user to fix all warnings. Here is how Google is rendering ShoutMeLoud after editing & fixing the Robots.txt file.

Fixing Search bot CSS JS file issue
  • Save

For the reference, you can see ShoutMeLoud Robots.txt file here.

Why Google bots need to access theme CSS & JS files?

You might ask this question as earlier it was not essential to give Google access to your theme part. CSS & JS is not typically a part of the content & here is what I have found on official help page in answer for this question:

Why google need to access css js file
  • Save


A web page relies on the availability of my_script.js, which is typically run by web browsers to provide the browsers with the core textual content of the page. If my_script.js is blocked from Google, we won’t be able to get the text content when Googlebot renders the web page.

Here is a video by Matt Cutts where he shared why you should not block Javascript & CSS:

Subscribe on YouTube


Usually, I won’t bother much about a plugin JS file being blocked which have nothing to do with the site display. But after this mass warning email, it’s better to be safe & let Google access your site completely. In the majority of cases, you are good just to block your WP-admin area in WordPress Or sensitive (Dashboard, private area) while using any other platform.

Must read:

I hope this detailed guide answered all your question regarding Google mass mail to webmasters regarding Google bot unable to access CSS, JS or any other file.

Do let me know if you also received similar warning mail? Have you fixed all the warnings? If you have any interesting insights to share about this issue, do share with us in the comment section below.

Was this helpful?

Thanks for your feedback!
  • Save
Authored By
A Blogger, Author and a speaker! Harsh Agrawal is recognized as a leader in digital marketing and FinTech space. Fountainhead of ShoutMeLoud, and a Speaker at ASW, Hero Mindmine, Inorbit, IBM, India blockchain summit. Also, an award-winning blogger.

38 thoughts on “How To Fix Googlebot Cannot Access CSS & JS Warning”

  1. James

    The best and easy way to Fix this is to look at the Robots.txt File of other sites , what i did is i searched and copy paste in my site 🙂

    i landed to this article when i search this error , you are updating articles very fast based on our need ,Thanks Harsh

  2. Xalmey

    Hi Harsh, I got this message for my websites and two of them are not showing google ads now. though working fine on SmartPhone. I thought it could be an issue with my laptop but I witnessed decline in pageviews/impressions. will the “allow JS/CSS” in robots.txt file fix my issue? kindly advise

  3. Gaz

    I removed the wp-incudes from my robots.txt file but still the same result is shown when I fetch & render my website.
    Also, the Webmaster tool shows an error on wp-content on robots.txt file.
    Is it safe to remove wp-contents line from robots.txt ?

  4. Pradhyuman

    Hey Harsh,
    I have removed this line ” Disallow: /wp-includes/ ” from the robots.txt file but still robots.txt tester shows this line. Don’t know actually what is the issue. I have rechecked my robots.txt file and this line is not present but tester still shows the same error.
    I ahve also submitted a request to let Google know robots.txt file has been updated. But all in vain.

  5. Giri

    Harsh thank you for your help. I was bit confused with this alert.

    Its pointing to below options. Is it safe to remove?

    Disallow: /wp-content/
    Disallow: /wp-*


    1. Arun

      The simplest thing is to add below code to your robot file

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

      In addition, you can use the robots.txt testing tool in Search Console to identify if there are any other crawling issues.

      1. Adrienne

        This did the trick for me!

  6. Stephen Finnerty

    The most direct and simplest explanation I have found on this topic. Much appreciated!

  7. Ali Rao

    you simply removed the wp-admin/include line from that file?
    mine is showing. tell should i remove all from the list?
    Googlebot couldn’t get all resources for this page. Here’s a list:
    URL Type Reason Style Sheet Blocked robots.txt Tester Script Temporarily unreachable Script Blocked Script Blocked Script Blocked

  8. Jay

    Thank you, harsh.

    I received same error. Google blocked Js and Css files. So thank you for solved this issue.

  9. Ajay

    Harsh, I have a question. How I can be sure that after removing /wp-include/ and in my case /wp-content/ from robots.txt will insure that there is no such Javascript and CSS file blocked in “Blocked Resources”?

  10. Tara

    I need some help with this.
    On my WordPress Robots.txt file I see this
    # BEGIN WordPress

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    There is no option to delete the Disallow: /wp-includes/. However in Google Search Console on the robots.txt tester I have this
    User-agent: *
    Disallow: /wp-admin/

    what do I do next?

    1. Harsh Agrawal

      What you are looking at is .htaccess file. You need to edit the robots.txt file.

      1. Thyrone Charles

        Hi Harsh,
        Even I have the same problem what Tara had. And your reply is right. We are looking .htaccess file. On my page it says, “you don’t have robots.txt file, create one here”. So what can I do? What to add on my new robots.txt file?
        I had the same problem what you explained on this article.
        I mean, there are some .css and .js files blocked.
        Expecting your reply as soon as possible.

  11. Rohit Mewada

    Thanks harsh For Share this information with Detail.
    Now I also also solve my site error.

  12. Rahil

    This is really amazing information you share with shouters. Its will usefull for all webmasters. I share this information to my fb account

    Hope this article reach to many webmasters.

    Thank you haesh.

  13. Kieren

    And another soulless grind through a pile of robots.txt files beckons. I swear Google’s got it in for me and everyone else gets caught up in it.

  14. Peterson

    Awesome collection,thanks for sharing new updates to us…

  15. Swadhin Agrawal

    Hi Harsh sir,
    I too have gotten this email. I will do what you advised i.e. remove wp/includes. the thing that now wories me more is I saw many sites’ robots.txt and all have different ones. Even your’s is different than mine. WHat can we do about this 🙂

    I on’t have the line about ninja bots should I add it?

    thank you,

  16. James

    Thanks, But for people who use wordfence plugin. This is not enough to get rid the googlebot error.

  17. vikas yadav

    I am getting this warning from Google regularly. I tried to learn about this problem on Google but couldn’t be able to resolve this issue. But, after reading your blog post I have resolved all the issues of one of my website.
    Thanks you sharing such a useful post along with such an easy explanation.

  18. Arthur

    i receded this email today. I was scared until I read your article. Thank you so much. Regards from Brazil.

  19. Ferri

    Thanks harsh. I’m just get a message too.. thanks for your tips..
    Today, some people get that alert from Google.
    you’re post is fast & up to date. 🙂

Leave a Comment

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

Scroll to Top