blocking javascript css indexing google
This entry was posted on .

Blocking JavaScript & CSS Affects Indexing


Does your site block JavaScript or CSS files? Then you could be about to lose out in Google’s search rankings. Google announced today that it has updated its Webmaster Guidelines, in line with the update of their indexing system. As explained on their Webmaster Central Blog, Google has made this update to its indexing system to allow it to function more like a modern browser.This naturally includes having CSS and JavaScript active – as a result of this, blocking CSS and JavaScript files from being crawled will have a detrimental effect upon your indexing, and therefore upon your site’s search rankings in Google.

What does that mean?

For optimal rendering and indexing, you should make sure that Googlebot has access to the JavaScript, CSS, and image files that your pages use. Disallowing crawling of Javascript or CSS files in your site’s robots.txt directly will harm how well your algorithms render and index your content. This will most likely result in suboptimal rankings.

Updated advice for optimal indexing

Google indexing systems have, up until now, been strongly attached to the text cached version (Lynx style). Now that indexing is based on page rendering, that’s no longer accurate. The new system more closely resembles a modern web browser. Accordingly, Google recommends the following tips:

1. Ensure that your web design follows the principles of progressive enhancement. This will help Google’s systems see usable content and basic functionality even when certain web design features are not yet supported.
2. Work hard to make your pages render quickly. This is beneficial for both user experience and efficient indexing. You should aim to:
- Get rid of unnecessary downloads
- Merge your separate CSS and JavaScript files and configure your server to serve them compressed

You’ll also have to check that your server can handle the additional load Google has also updated the “Fetch and Render as Google” feature allowing you to see how their systems will render the page. As a result of this, you’ll be able to identify a number of indexing issues such as improper robots.txt restrictions and redirects that Googlebot cannot follow.

For more information, visit the Google Webmaster Guidelines directly.