Do your WordPress Pages Use Too Many JavaScript and CSS Files? Fix This SEMRush Site Audit Warning Now!

Recently I encountered a warning in the SEMrush site audit report for the ThosPFuller.com WordPress website which indicated that two pages use too many JavaScript and CSS files. This is potentially a problem, not just for the pages identified, but for the entire site. The WordPress Content Management System (CMS) follows a plugin architecture which means that JavaScript and CSS files may be unnecessarily included across the entire site, hindering performance for all posts and pages. The ThosPFuller.com website does not have any custom PHP coding and this problem is unlikely to be related to the core WordPress platform, so that leaves us with the plugins which are likely the culprit here — it is reasonable to suggest that we have one or more plugins in use that should be disabled and/or deleted.

Step One: Perform a SEMrush Site Audit Investigation

This issue was identified from the resultant SEMRush Site Audit report. A picture of the report appears below with a pointer to the top issues. I am a bit surprised this hasn’t impacted more pages but for whatever reason, two stand out and this is a potentially more significant issue than perhaps appears at first glance.

A SEMrush Site Heath report with a pointer to Top Issues where 2 pages use too many JavaScript and CSS files.
Why do 2 pages use too many JavaScript and CSS files?

Step Two: Remedy The Pages Use Too Many JavaScript and CSS Files Issue by Deactivating WordPress Plugins

I looked into this a bit and suspected that the issue was likely due to the following:

  1. The ThosPFuller.com site uses the OceanWP Theme and Elementor page builder plugin.
  2. The Gutenberg WordPress theme plugin and CoBlocks page builder plugin (see also CoBlocks on GitHub) are both present but not in use.
  3. We shouldn’t need these two WordPress plugins and the site functions fine after deactivating them.

Prior to disabling these plugins I checked one of the identified pages and noticed that it had 114 occurrences of “.js” and 99 occurrences of “.css” in the page source (this count was determined using a simple find). After disabling these plugins the same page had 65 occurrences of “.js” and 66 occurrences of “.css” and the SEMrush warning is gone.

Below we can see the site audit report after these two plugins were disabled — note that the “2 pages use too many JavaScript and CSS files” top issue is now gone and the Site Health has improved by 1%, the Site Performance has improved by 4% and we also have fewer warnings and notices.

The WordPress plugins page with a pointer to the option to deactivate a WordPress plugin when attempting to fix the WordPress pages use too many JavaScript and CSS files SEMrush issue.
Deactivate the unused WordPress plugin when attempting to fix the WordPress pages use too many JavaScript and CSS files SEMrush issue.

Once we’ve deactivated the unused WordPress plugin the next step is to test the website.

Step Three: Test The Website

We need to test that the website is still functioning, of course, otherwise, we might remedy the pages use too many JavaScript and CSS files issue but end up with a broken website. Since plugins can have an impact across the entire site, it’s important to check that the site isn’t experiencing a problem. For a personal or professional website, checking a few pages may be good enough however for business and especially e-commerce websites, more robust testing may be required.

Step Four: Execute another SEMrush Site Audit and Check that the Issue Has Been Addressed

We’ll run the SEMrush Site Audit again and check that the results indicate that the warning is gone — we can see that this is the case in the image below.

A SEMrush Site Heath report with a pointer to Site Performance improvement of 4% and an overall Site Health improvement of 1%.
The issue where two pages use too many JavaScript and CSS files has been fixed!

The next step will be to delete unused WordPress plugins.

Step Five: Delete Unused WordPress Plugins

Once we’re satisfied that the website has been tested and is working as we’d expect it to, we can then remove the unused plugins. This is recommended because unused WordPress plugins can still weigh down a website, even if they’ve been deactivated. We don’t need them, we don’t want them, so let’s delete them.

We should also rerun the SEMrush Site Audit and check that the issue has been addressed. We can see the result of this in the image below.

The WordPress plugins page with a pointer to the option to delete a plugin -- this is the last step when attempting to fix the WordPress pages use too many JavaScript and CSS files SEMrush issue.
Delete the deactivated WordPress plugin -- this is the last step when attempting to fix the WordPress pages use too many JavaScript and CSS files SEMrush issue.

We can opt to retest the site again at this point. For a personal or professional website, this step may be unnecessary whereas for a proper business or e-commerce website we may want to run a final set of tests, just to ensure that nothing was missed.

Why You Should Remove Unused WordPress Plugins 

According to the article entitled “Removing Unused WordPress Plugins” by Oliver Whitham [1]:

By learning how to fully uninstall plugins you no longer use, you can ensure that your website doesn’t accumulate files and data you don’t need. In practice, this means you can keep your site running smoothly and your loading times lean.

Expanding on this quote above, there are specific benefits to only using required WordPress plugins:

  1. You know exactly what you need for your WordPress website to function properly.
  2. It’ll be easier to update versions of PHP because there are fewer plugins that may be outdated. Outdated plugins that rely on older versions of PHP can be problematic and block an upgrade which then impacts the upgrade path for the entire site.
  3. The surface area for website security-related issues will be smaller [1].
  4. This avoids database bloat [1] however the MySQL instance your WordPress website relies on may benefit from optimization as plugins often leave dependent tables and data in the database — there are WordPress optimization plugins that can help with this [3, 4].
  5. It is, generally speaking, good software development practice to use only what you need. This idea applies as much to WordPress administration as well.
  6. Plugins can have ramifications that impact the entire site and not just these two pages identified in the SEMrush Site Audit report.
  7. Unused plugins that are still active can have a performance impact across the entire WordPress website. If it’s bad enough the bounce rate might be artificially inflated because people aren’t waiting for pages to load. This becomes particularly important when optimizing for speed as there’s the potential to get some quick and easy performance gains simply from removing unused plugins.
  8. If you’re running WordPress in the Amazon Web Services Cloud (AWS) or on another cloud provider with a similar billing strategy, a slow WordPress website will likely result in a higher monthly bill.

When it comes to Performance optimization, which is related to Technical SEO, everything listed above comes into focus when it pertains to achieving fast page load times. Below I’ve included a picture of one of the performance reports for an article on this site. Performance engineering is something I spent a fair amount of time on and achieving fast results, even when hosting WordPress with a fast provider, still requires effort, discipline, and constant attention.

The GTMetrix Performance Report for the Technical SEO article entitled "Hot to Fix the og:image Open Graph Meta Tags Are Missing Critical Issue". with a grade of A, performance at 94% and structure at 95%; web vitals include an LCP at 1.1s, TBT at 171ms, and CLS at 0.02.
GTMetrix.com Performance Report for the How to Fix the og:image Open Graph Meta Tags Are Missing Critical Issue Technical SEO article.

For simple blogs what I’ve mentioned above may be low-priority issues however for high-traffic WordPress eCommerce websites these problems can impact the bottom line, and losing both customers and their money quickly becomes a serious problem.

WordPress Pages Use Too Many JavaScript and CSS Files: Article Conclusion

I hope this article has been helpful at revealing how a simple issue identified by a SEMrush Site Audit report that indicates that several pages have too many JavaScript and CSS files can turn out to be a fairly significant problem.

It is still possible that there are other plugins adding unnecessary JavaScript and CSS files however I tend to be fairly judicious with my use of plugins and this is less likely at this point.

Have you encountered this problem? Do you disagree with anything here or have I forgotten anything? Let me know in the comments!

Technical SEO References

  1. Removing Unused WordPress Plugins
  2. The original Technical SEO / pages use too many JavaScript and CSS files issue post on LinkedIn
  3. 14 Best WordPress Database Plugins (Clean and Optimize Your DB) by Matteo Duò
  4. WordPress Database Plugin: 6 Options for Cleaning and Development
  5. How to Fix the og:image Open Graph Meta Tags are Missing Critical Issue

ThosPFuller

When it comes to Digital Marketing as a/an: Organic SEO Consultant: I can help improve your website traffic, increase search engine rankings, and increase brand visibility; Technical SEO Consultant: I can help improve your website performance, identify and fix errors, improve crawlability, and optimize your website structure and code; WordPress SEO Consultant: I can help improve your WordPress website ranking, improve your WordPress website usability, and optimize your WordPress website content and plugins. I am based in Northern Virginia -- which is included in the Washington DC metropolitan area.