In short
Ahrefs flags "JavaScript broken" for JavaScript file URLs used on your site that return a 4xx or 5xx error. Features that depend on the file break for visitors, and if the script renders content, search engines may not see that content. Common causes are files removed by a plugin or theme update, cache or minification plugins serving outdated file names, and third-party scripts that no longer exist. Restore the file or remove the reference.
When a script file fails to load, whatever it powers stops working: a mobile menu, a contact form, a slider, or analytics tracking.
Common causes
| Cause | Fix |
|---|---|
| Caching or minification plugin serves old combined files | Clear the plugin's cache and the CDN cache |
| Theme or plugin update renamed or removed a file | Update or reinstall the theme or plugin |
| Build tool generates hashed filenames, but old HTML is cached | Purge HTML cache after each deploy |
| A third-party script was discontinued | Remove the script tag |
| File blocked by a firewall rule | Allow the path |
How to fix it
Open the file URL to confirm the error.
Check the page's DevTools Console for related errors.
Clear caches, then recrawl. Many broken script flags disappear after a cache purge.
If the file is truly gone, remove its script tag or replace it.
WordPress: clear your caching or optimization plugin's cache. If a plugin was deleted but its scripts are still referenced, check the theme's functions.php or header settings.
Shopify: look for script tags left by uninstalled apps in theme.liquid or app snippets.
Webflow and Wix: check custom code in site settings and page settings for scripts that no longer exist.
Custom builds: when deploying with hashed filenames (Vite does this by default), upload the new HTML and assets together, and keep the previous assets for a short time so cached pages don't break.
This guide isn't affiliated with or endorsed by Ahrefs.
Related issues
Sources and references
Google Search Central, Understand JavaScript SEO basics

About the author
Nazmul Nikhil
Head of SEO & Assistant Manager, Digital Marketing at Notionhive
SEO and AI search consultant in Dhaka, Bangladesh, helping small and mid-size businesses in the USA, UK, Australia and Canada.



