Wordpress, Joomla, & Drupal Solutions for Googlebot cannot access CSS and JS

WordPress, Joomla, & Drupal Solutions for “Googlebot cannot access CSS and JS”

Joomla Solution


Assuming that our template is called “mytemplate”, and as a rule all templates have a / css / directory, we will open the door through robots.txt to our CSS directory, or even all of our template directories.
To do this we introduce one of the following options in our robots.txt:
Allow: / templates / mytemplate / css /
Allow: / templates / mytemplate /


WordPress Solution


A few ways WordPress can block these files:

robots.txt file is blocking crawling of this subfolder /wp-includes
robots.txt is blocking crawling of JS and CSS files
A security plugin such as iThemes Security is blocking JS and CSS crawling

To fix the error and allow Googlebot to crawl your JS and CSS files, take the following steps:

Check your robots.txt file. You can FTP in, use Google’s robots.txt tester, or simply visit yourwebsite.com/robots.txt. It should look something like this:

User-agent: *
Disallow: /wp-admin/

If you’re using iThemes Security, uncheck the “disable directory browsing” box. Using it blocks access to JS and CSS files via the .htaccess file.


Drupal Solution


To allow Googlebot to access your Javascript and CSS files, add a specific User-agent for Googlebot, repeating the rules you already have, and adding the new “Allow” rules.

Allow: /*.js*
Allow: /*.css*
Allow: /misc/*.js
Allow: /modules/*.js
Allow: /modules/*.css

Notify of
Inline Feedbacks
View all comments