back to blog

Fix It: Googlebot cannot access CSS and JS files on my website

 

If you have a WordPress or Joomla website, you may have received an email from Google Search Console (Google Webmaster Tools) recently. While not always a cause for alarm, the fix is as easy as removing a line in a text file. We’ll show you which line, but first:

Why does Googlebot need to access my CSS and JS files?

Gone are the days when Google would be content merely indexing your website’s content based on your website’s HTML code alone. Today, Google attempts to load your website’s stylesheets and JavaScript to understand your website as a user would see it. It still can’t read items like text hidden in images, but it does give it a more solid understanding of what parts of your content are section headers and what may or may not be hidden content.

If you’re using advanced CSS stylesheets or JavaScript dependent content, that Google is trying to work with you on this is a great thing provided you weren’t trying to pull the SEO wool over their eyes.

Googlebot needs access to your CSS and JS files because wants to use the web like Google’s own users. As such, you should do your best to make its experience as readable as your human audience.

How to make WordPress more Google Friendly

A standard robots.txt file for WordPress typically looks like the lines below.

User-agent: *

Disallow: /wp-admin/

Disallow: /wp-includes/

 

This instructs Googlebot and other indexing tools to stay out of your WordPress admin and WordPress inclusion files, the folder which holds your CSS stylesheets. Delete this last line, upload to your server and you’ll be back up on Google’s next check. If you can’t make these changes yourself, forward this article along to your webmaster. Barring a few cool plugins, this cannot be done from inside WordPress.

How to make Joomla more Google Friendly

A standard robots.txt file for Joomla typically looks like the lines below.

User-agent: *

Disallow: /administrator/

Disallow: /bin/

Disallow: /cache/

Disallow: /cli/

Disallow: /components/

Disallow: /includes/

Disallow: /installation/

Disallow: /language/

Disallow: /layouts/

Disallow: /libraries/

Disallow: /logs/

Disallow: /modules/

Disallow: /plugins/

Disallow: /tmp/

 

Like WordPress, this robot bouncer keeps Googlebot out of the red carpet admin areas. Like any good bouncer, it may be a bit over zealous in its duty. Let Google in a little more by ensuring /templates isn’t disallowed. You may also need to allow certain plugins if they handle much of your content. Do this by adding the following line to your robots.txt file:

Allow: /plugins/system/example_plugin/plugin_assets/

These updates can’t be changed from within Joomla and require FTP access to your own server. If you can’t make these changes yourself, forward this article along to your webmaster or agency.

Ready to get started?

It seems like you're ready to do more. This is why we have to meet.