Title: Googlebot cannot access CSS and JS files
Last modified: August 30, 2016

---

# Googlebot cannot access CSS and JS files

 *  [jimmerd](https://wordpress.org/support/users/jimmerd/)
 * (@jimmerd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/)
 * I just got an email from Google saying:
 * Googlebot cannot access CSS and JS files
 * on my site.
 * Seems the robots.txt file is disallowing wp-admin/ and wp-includes/
    which it
   has always done.
 * BUT there’s CSS and/or JS in there that Google wants to be able to see.
 * How to fix? Allow all?
 * Has the Googlebot lost its mind?
 * THANKS!

Viewing 15 replies - 1 through 15 (of 94 total)

1 [2](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/3/?output_format=md)…
[5](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/5/?output_format=md)
[6](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/6/?output_format=md)
[7](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/7/?output_format=md)
[→](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/2/?output_format=md)

 *  [ankurj](https://wordpress.org/support/users/ankurj/)
 * (@ankurj)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374242)
 * Yes, Same here!
    I also received warning about an hour back.
 * For some reason, Google bot wants to see some CSS and JS files. Not sure if it
   is a genuine warning we should care about?
 *  [allegroconsultants](https://wordpress.org/support/users/allegroconsultants/)
 * (@allegroconsultants)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374243)
 * you need to edit your robots.txt file. this seems to be something new for google
   to care about.
    here is an example of the robots.txt you will need, just edit
   the one you have an put the allow lines in.
 * User-agent: *
    Disallow: /cgi-bin/ Disallow: /wp-admin/ Disallow: /wp-includes/
   Disallow: /wp-content/cache/ Allow: /wp-content/themes/ Allow: /wp-content/plugins/
   Allow: /wp-content/uploads/ Allow: /wp-includes/css/ Allow: /wp-includes/js/ 
   Allow: /wp-includes/images/
 *  [ankurj](https://wordpress.org/support/users/ankurj/)
 * (@ankurj)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374245)
 * As far as I know, robots.txt doesn’t understand **Allow** tag.
 * Anything not under **Disallow** tag is automatically allowed.
 *  [g0rd](https://wordpress.org/support/users/g0rd/)
 * (@g0rd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374248)
 * That’s not accurate ankurj. [stackoverflow](http://stackoverflow.com/questions/7609031/robots-txt-allow-sub-folder-but-not-the-parent)
   has good information about using Disallow and Allow. As mentioned previously,
   allow the files that Google wants to see for its smartphone render.
 *  Thread Starter [jimmerd](https://wordpress.org/support/users/jimmerd/)
 * (@jimmerd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374249)
 * Well, that mostly worked but it’s still returning an error for one PHP file/script,
   apparently due to the WordFence plugin:
 * [http://MYSITE.us/site2014/wp-admin/admin-ajax.php?action=wordfence_logHuman&hid=1717E62F164CDE77F5220B2D3B3B7AA4&r=0.03589733876287937](http://MYSITE.us/site2014/wp-admin/admin-ajax.php?action=wordfence_logHuman&hid=1717E62F164CDE77F5220B2D3B3B7AA4&r=0.03589733876287937)
 * which is blocked because it’s in wp-admin/
 *  [ankurj](https://wordpress.org/support/users/ankurj/)
 * (@ankurj)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374251)
 * [@g0rd](https://wordpress.org/support/users/g0rd/): Thanks for clarifying that.
   I stand corrected.
 * Did some more digging and found this from Google.
 * [https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt](https://developers.google.com/webmasters/control-crawl-index/docs/robots_txt)
 *  [soamz](https://wordpress.org/support/users/soamz/)
 * (@soamz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374254)
 * So whats the solution now ?
 * Do as allegro consultants said ?
 *  [soamz](https://wordpress.org/support/users/soamz/)
 * (@soamz)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374255)
 * So add that to the robots.txt file as allegro consultants said ?
 *  Thread Starter [jimmerd](https://wordpress.org/support/users/jimmerd/)
 * (@jimmerd)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374256)
 * Yoast seems to think it’s best to simply allow all.
 * [https://yoast.com/wordpress-robots-txt-example/](https://yoast.com/wordpress-robots-txt-example/)
 *  [gavinr](https://wordpress.org/support/users/gavinr/)
 * (@gavinr)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374257)
 * I’m getting these emails from Google today too, but seems to be only on my sites
   that are using Cloudflare – could that be related or is it definitely just a 
   robots.txt issue?
 *  [gbox12](https://wordpress.org/support/users/gbox12/)
 * (@gbox12)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374258)
 * I got this
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteRule ^index\.php$ - [L]
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
       ```
   
 * and I still get the message
 *  [Jim Birch](https://wordpress.org/support/users/jimbirch/)
 * (@jimbirch)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374259)
 * I would recommend:
 *     ```
       User-agent: *
       Disallow: /wp-admin/
       Disallow: /wp-includes/
       Disallow: /wp-content/cache/
   
       User-agent: Googlebot
       Disallow: /wp-admin/
       ```
   
 * Here is Google’s original post about the change:
    [http://googlewebmastercentral.blogspot.com/2014/10/updating-our-technical-webmaster.html](http://googlewebmastercentral.blogspot.com/2014/10/updating-our-technical-webmaster.html)
 *  [Matt Magi](https://wordpress.org/support/users/matt94gt/)
 * (@matt94gt)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374270)
 * I just got this email as well for about 20% of my websites.
 * Jimmbirch why would you disallow the cache?
 * **Many of the sites that I got this notification from have this in their robots
   file:**
 * User-agent: *
    Disallow: /wp-admin/ Disallow: /wp-includes/ Disallow: /xmlrpc.
   php
 *  [lespo](https://wordpress.org/support/users/lespo/)
 * (@lespo)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374283)
 * It can’t be coincidence we’re all getting these emails from Google today – I 
   wonder if it’s related to a recent WP update or plugin update. My robots.txt 
   file is:
    **User-agent: \* Disallow: /wp-admin/ and I’ve not had problems until
   today.
 *  [Matt Magi](https://wordpress.org/support/users/matt94gt/)
 * (@matt94gt)
 * [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/#post-6374291)
 * Apparently google just started sending out the JS/CSS warnings today (even though
   they have been using this method for some time) which would explain why we all
   are just finding out:
    [http://www.thesempost.com/new-google-search-console-warning-for-googlebot-cannot-access-css-and-js-files/](http://www.thesempost.com/new-google-search-console-warning-for-googlebot-cannot-access-css-and-js-files/)
 * More info above.
 * I guess its OK to allow all now. As google is smart enough apparently not to 
   index wp core files. They started targeting css/js a while back on their last
   update, but are now just sending out warnings. Here are some articles:
    [https://yoast.com/google-panda-robots-css-js/](https://yoast.com/google-panda-robots-css-js/)
   [https://yoast.com/wordpress-robots-txt-example/](https://yoast.com/wordpress-robots-txt-example/)
 * **\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
    \*\*\*\*\*\*
   THE SOLUTION\*\*\*\*\*\* \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
 * **We should just keep all our robots.txt files blank from now on. There is no
   longer a need to block core wp directories.**
 * I just updated my robots.txt. I removed my disallow of wp-includes, wp-admin 
   etc. and now google is rendering my websites properly.
 * To test it, login to webmaster tools, and simply fetch and render as google. 
   If your site appears in the screenshot to not be loading CSS then your robots.
   txt is blocking it somehow.

Viewing 15 replies - 1 through 15 (of 94 total)

1 [2](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/3/?output_format=md)…
[5](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/5/?output_format=md)
[6](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/6/?output_format=md)
[7](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/7/?output_format=md)
[→](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/2/?output_format=md)

The topic ‘Googlebot cannot access CSS and JS files’ is closed to new replies.

## Tags

 * [robots.txt](https://wordpress.org/support/topic-tag/robots-txt/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 94 replies
 * 47 participants
 * Last reply from: [yayabobi](https://wordpress.org/support/users/yayabobi/)
 * Last activity: [10 years, 11 months ago](https://wordpress.org/support/topic/googlebot-cannot-access-css-and-js-files/page/7/#post-6374583)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
