Title: Broken JavaScript/CSS
Last modified: April 22, 2021

---

# Broken JavaScript/CSS

 *  Resolved [rosscollins](https://wordpress.org/support/users/rosscollins/)
 * (@rosscollins)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/)
 * Good morning!
 * I’ve just crawled the site on Ahrefs and it’s saying I have 101 pages with broken
   JavaScript & 99 pages with broken CSS, all the pages are showing a 410 error 
   for this: [https://sunaccounts.com/wp-content/cache/autoptimize/js/autoptimize_single_882b5f5a232cfdc6ac54f54e4753f097.js](https://sunaccounts.com/wp-content/cache/autoptimize/js/autoptimize_single_882b5f5a232cfdc6ac54f54e4753f097.js).
 * Can anyone shed any light on why we’re getting this error? How do we fix this?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fbroken-javascript-css%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14351275)
 * don’t know how afhrefs works, but as the static JS file is not really missing,
   this rather seems a problem on ahrefs side, no? 🙂
 *  Thread Starter [rosscollins](https://wordpress.org/support/users/rosscollins/)
 * (@rosscollins)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352561)
 * Thanks for responding so quickly! I’m not very techy so don’t know how to tell
   if the static JS is missing or not? Is anything broken from auto-optimizers side
   to be giving this 410 error on 100 of our pages? I’m worried it’s going to effect
   our rankings/SEO!
 * Also, apologies, in my initial message I only shared the JS link that’s giving
   a 410 error. Here’s the CSS link that’s having a 410 error as well: [https://sunaccounts.com/wp-content/cache/autoptimize/css/autoptimize_d6be1115986adf6c9946e10a102e54e6.css](https://sunaccounts.com/wp-content/cache/autoptimize/css/autoptimize_d6be1115986adf6c9946e10a102e54e6.css)
   
   It’s the same JS & CSS link across all pages that’s creating the 410 error.
 * I’m not sure if this helps you or not, but this is what ahrefs says for **broken
   JS:**
 * Some pages on your website link to JavaScript file URLs that return one of the
   4xx or 5xx HTTP status codes to our crawler.
 * Broken JS files will not be rendered on your pages.
 * How to fix
 * Most likely, the JS file had been moved, renamed, or deleted but the link to 
   it was not modified.
 * Review the pages that have a broken link to the JS file and update or remove 
   it.
 * For 5xx HTTP status codes (server errors), you might need to address your web
   developer or hosting provider.`
 * And for broken CSS:
 * Some pages on your website link to CSS file URLs that return one of the 4xx or
   5xx HTTP status codes to our crawler.
 * Broken CSS files will not apply the necessary styles to your pages.
 * How to fix
 * Most likely, the CSS file had been moved, renamed, or deleted but the link to
   it was not modified.
 * Review the pages that have a broken link to the CSS file and update or remove
   it.
 * For 5xx HTTP status codes (server errors), you might need to address your web
   developer or hosting provider.`
    -  This reply was modified 5 years, 1 month ago by [rosscollins](https://wordpress.org/support/users/rosscollins/).
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352665)
 * well, when testing in the browser both the first and the second like work and
   return a HTTP 200 response instead of the HTTP 410 ahrefs sees (see below screenshot),
   so the conclusion is that from the point of view of Autoptimize (and your users)
   all is OK.
 * [[
 * why ahrefs is not able to see this is not something I can explain (but do ask
   them) I’m afraid …
 *  Thread Starter [rosscollins](https://wordpress.org/support/users/rosscollins/)
 * (@rosscollins)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352668)
 * Thanks for coming back to me so quickly 🙂 I’ll see if I can raise it with Ahrefs
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352674)
 * you’re welcome, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂
 * frank
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352690)
 * Ah, one idea that might be worth investigating; in some cases (although actively
   discouraged by the Googles) access to JS/ CSS files is blocked for bots/ search
   engines, maybe that is what’s happening here (Autoptimize does not do this)?
 *  Thread Starter [rosscollins](https://wordpress.org/support/users/rosscollins/)
 * (@rosscollins)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352724)
 * Thanks for the suggestion! I’m going to wait for the next ahrefs crawl and see
   if it’s still flagging it as an issue. If it is, I’ll forward your suggestion
   onto a developer who’s more technically qualified to check than me!
    Thanks again

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Broken JavaScript/CSS’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

## Tags

 * [broken CSS](https://wordpress.org/support/topic-tag/broken-css/)
 * [broken javascript](https://wordpress.org/support/topic-tag/broken-javascript/)

 * 7 replies
 * 2 participants
 * Last reply from: [rosscollins](https://wordpress.org/support/users/rosscollins/)
 * Last activity: [5 years, 1 month ago](https://wordpress.org/support/topic/broken-javascript-css/#post-14352724)
 * Status: resolved