Google Console’s warning about blocked CSS and JavaScript files – what should I do?

Posted on July 29, 2015

 

If you’re a regular user of Google Console (formerly Google Webmaster Tools), you may have received this warning for one of your websites, as Google has just started sending these out:

“Google systems have recently detected an issue with your homepage that affects how well our algorithms render and index your content. Specifically, Googlebot cannot access your JavaScript and/or CSS files because of restrictions in your robots.txt file. These files help Google understand that your website works properly so blocking access to these assets can result in suboptimal rankings.”

Google-console-warning

This sounds pretty serious and, at first glance, may worry some website owners. If Google can’t access something and your rankings could be ‘suboptimal’, then that’s bad, right?

Well, don’t worry, there’s no need for panic. This is a very simple fix and is usually caused by a line or two in your robots.txt file. Have a look at your robots.txt file and see if it includes one of these:

Disallow: /.js$*
Disallow: /.css$*

For WordPress sites specifically, it might include:

Disallow: /wp-content/
Disallow: /wp-content/themes
Disallow: /wp-content/plugins

If any of these lines are present, remove them. They’re basically telling Google it can’t access files with the extensions .css or .js and, for WordPress, it’s saying Google can’t look in the folder /wp-content/ or the themes and plugins folders.

You can test if your work has been successful by going to Google’s ‘Fetch as Google’ tool in Google Console, selecting your website property (if you have more than one) and clicking the ‘Fetch and Render’ button.

This will take a few moments before it is ready. Once it has been completed, click on the button with the green tick to see the results. If it has worked, you should see your website ‘as Google sees it’ displayed pretty much the same as how users will see it (with the CSS and JavaScript displaying correctly).

You can also check the results in the robots.txt Tester in Google Search Console to ensure your edits have been crawled by Google.

Technical Director at Engage Web
Darren is Technical Director at Engage Web, as well as being a co-founder of the company. He takes a hands-on approach to SEO and web design, helped by more than 20 years’ experience in these fields.
Call Now Button
>

Who Engage Web has helped:

Ice Lolly Minuteman Press BUNZLGS1 UK The Underfloor Heating Store West Cheshire Athletic Club Thomas Cook MWB Business ExchangeWeb Media 360 D2 Architects Beacon Financial Training Steely ProductsBurlydam Garden Centre Asentiv BodyHQ Clever Vine Endeavour Mortgages Pro Networks Comm-Tech Wickers World Ascot Mortgages Top Teks
TEL: 0345 621 4321