{"id":6915,"date":"2015-08-17T09:34:29","date_gmt":"2015-08-17T16:34:29","guid":{"rendered":"http:\/\/www.primeview.com\/?p=6915"},"modified":"2024-05-23T13:29:43","modified_gmt":"2024-05-23T20:29:43","slug":"googlebot-cannot-access-css-and-js-files","status":"publish","type":"post","link":"https:\/\/www.primeview.com\/blog\/googlebot-cannot-access-css-and-js-files\/","title":{"rendered":"What we did when Google sent us a note saying Googlebot cannot access CSS and JS files"},"content":{"rendered":"<p><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-6916 size-full\" title=\"Googlebot cannot access CSS and JS files\" src=\"\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/11.png\" alt=\"What we did when Google sent us a note saying Googlebot cannot access CSS and JS files\" width=\"500\" height=\"500\" srcset=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/11.png 500w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/11-150x150.png 150w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/11-300x300.png 300w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/11-100x100.png 100w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">A few days ago, we received an email from Google saying that Googlebot was unable to access CSS and JS files on some of our client\u2019s websites. Of course it caught our attention, Google noted that this issue can result in suboptimal rankings!<\/span><\/p>\n<p><iframe class=\"giphy-embed\" src=\"\/\/giphy.com\/embed\/10I6xDDHK6OI00\" width=\"480\" height=\"313\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>via GIPHY<\/p>\n<p><span style=\"font-weight: 400;\">So, what did we do? We simply followed Google\u2019s instructions.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">First<\/span><b>,<\/b><span style=\"font-weight: 400;\"> you need to identify the blocked resources.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">To do this, you must log into your Google Webmaster Dashboard and use the \u201cFetch as Google\u201d tool under Crawl and Fetch and Render your URL..<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><img decoding=\"async\" class=\"aligncenter wp-image-6920 size-full\" title=\"Fetch as Google tool\" src=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-4.png\" alt=\"googlebot cannot access CSS and JS files 4\" width=\"1203\" height=\"266\" srcset=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-4.png 1203w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-4-300x66.png 300w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-4-1024x226.png 1024w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-4-624x138.png 624w\" sizes=\"(max-width: 1203px) 100vw, 1203px\" \/>After a few minutes, you will be able to access the results page that will show you a list of blocked resources.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">After identifying the blocked resources<\/span><b>, <\/b><span style=\"font-weight: 400;\">you should unblock them in your robots.txt<\/span><\/p>\n<p><span style=\"font-weight: 400;\">We found out that the blocked resources in our client\u2019s site are located in the following folders : <\/span><\/p>\n<p><span style=\"font-weight: 400;\">\/wp-content\/<\/span><br \/>\n<span style=\"font-weight: 400;\">\/wp-includes\/<\/span><br \/>\n<span style=\"font-weight: 400;\">\/fonts\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Take note that there are many ways to do this. In our client\u2019s case, we unblocked the resources by removing the restrictions in their robots.txt. This is how their robots.txt looks now :<\/span><\/p>\n<p><span style=\"font-weight: 400;\">User-agent : *<\/span><br \/>\n<span style=\"font-weight: 400;\">Disallow: \/wp-admin\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If you are using a CDN like we do, you\u2019re going to have to use a custom robots.txt set up to unblock the resources from your CDN.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Login to your MaxCDN account<\/span><br \/>\n<span style=\"font-weight: 400;\">Click on Manage beside your site\u2019s URL then choose <a href=\"https:\/\/www.primeview.com\/digital-marketing\/seo\/\">SEO<\/a><\/span><\/p>\n<p><img decoding=\"async\" class=\"alignnone wp-image-6919 size-full\" title=\"MaxCDN\" src=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-2.png\" alt=\"googlebot cannot access CSS and JS files 2\" width=\"625\" height=\"266\" srcset=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-2.png 625w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-2-300x128.png 300w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/googlebot-cannot-access-CSS-and-JS-files-2-624x266.png 624w\" sizes=\"(max-width: 625px) 100vw, 625px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Click on all check boxes and enter your custom robots.txt<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-6918 size-full\" title=\"custom robots.txt\" src=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/21.png\" alt=\"googlebot cannot access CSS and JS files 2\" width=\"500\" height=\"500\" srcset=\"https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/21.png 500w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/21-150x150.png 150w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/21-300x300.png 300w, https:\/\/www.primeview.com\/wp-content\/uploads\/2015\/08\/21-100x100.png 100w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><span style=\"font-weight: 400;\">The final step is to check if the resources are now unblocked. To do this, just repeat the first step.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">If your result still comes back as \u201cPartial\u201d, you may be using blocked resources from other sites.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Don\u2019t worry, Google won\u2019t penalize you because those resources are no longer in the webmaster\u2019s hands.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A few days ago, we received an email from Google saying that Googlebot was unable to access CSS and JS [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":8608,"comment_status":"closed","ping_status":"open","sticky":false,"template":"templates\/single-post-full-width-banner-with-sidebar.php","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[36,59,55,11],"class_list":["post-6915","post","type-post","status-publish","format-standard","hentry","category-blog","tag-google-updates","tag-news","tag-on-site-optimization","tag-seo"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/posts\/6915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/comments?post=6915"}],"version-history":[{"count":1,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/posts\/6915\/revisions"}],"predecessor-version":[{"id":23806,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/posts\/6915\/revisions\/23806"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/media\/8608"}],"wp:attachment":[{"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/media?parent=6915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/categories?post=6915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.primeview.com\/wp-json\/wp\/v2\/tags?post=6915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}