Speed up your WordPress site: A Guide to Unloading Unnecessary Code

Speed up your WordPress site

Learning how to speed up your WordPress site through unloading unnecessary code will go a long way towards helping your website perform better.

One of the greatest features of WordPress and WooCommerce is the amount of plugin and theme options available for site owners. However, every WordPress plugin you install will add extra code to your website, code that will add to your WordPress site’s load times.

Some of this code will be necessary but to speed up your WordPress site you will need to understand why it is necessary and where it is necessary. For example, you might have a WordPress contact form plugin installed on your website to allow your visitors to send you enquiries. If you only use a form on your website’s contact page, you can speed up your WordPress site by unloading all of that plugin’s javascript code and css on every other page of your website.

After all, if there’s no contact form on your homepage, why let that plugin load all its code on your home page! Unloading unnecessary code on your WordPress site can be a tricky process and it’s not without its risks but it is critical if you need to speed up your WordPress site.

In this guide we are going to cover one of the WordPress speed optimisation plugins we frequently use on slow loading WordPress websites – Asset Cleanup Pro. This plugin when used correctly will allow you to speed up your WordPress site significantly and by following the steps below you will immediately start seeing results.

Why Is Speed Important for Your WordPress Site?

Before we delve into how to speed up your WordPress site, let’s understand why speed is paramount for your WordPress site. Speed plays a crucial role in enhancing user experience, boosting search engine rankings, and increasing conversions.

A slow website can drive visitors away, impacting your site’s engagement and revenue. According to research by Google, 53% of mobile site visitors abandon a page if it takes more than three seconds to load. Therefore, optimising your WordPress site for speed is not just an option; it’s a necessity in today’s fast-paced digital landscape.

Analysing Your WordPress Site’s Performance

To effectively speed up your WordPress site, it’s essential to analyse its current performance and identify areas that need attention. Several tools can help you assess your website’s speed and diagnose potential bottlenecks.

Two widely used tools are Google PageSpeed Insights and GTmetrix. These free website speed analysis tools provide valuable insights into your site’s performance metrics, such as page load time, time to interactive, and opportunities for improvement.

Google PageSpeed Insights

Google PageSpeed Insights is a powerful tool that analyses the content of a web page and generates suggestions to make that page faster. It provides a score ranging from 0 to 100, indicating how well your site performs. Additionally, PageSpeed Insights highlights opportunities and diagnostics, giving you actionable recommendations to optimise your website.

To use PageSpeed Insights:

  1. Go to the PageSpeed Insights website.
  2. Enter your website’s URL and click “Analyse.”

Once the analysis is complete, you will receive a detailed report with suggestions tailored to your website.


GTmetrix is another valuable tool that assesses your website’s speed performance. It provides a comprehensive report with detailed information about various performance aspects, including page load time, total page size, and the number of HTTP requests made by your site. GTmetrix also offers a grading system (A, B, C, D, E, F) to evaluate your site’s performance, making it easy to track improvements over time.

To use GTmetrix:

  1. Visit the GTmetrix website.
  2. Enter your website’s URL and click “Test your site.”

GTmetrix will analyse your website and present a detailed report highlighting areas that require optimisation.

Reducing Unnecessary Code in WordPress

Now that we understand the importance of speed and have assessed our website’s performance, let’s explore various methods to reduce unnecessary code in WordPress. By eliminating unused or redundant code, you can speed up your WordPress site and boost its overall performance.

1. Remove Unused Themes and Plugins

Unused themes and plugins not only take up valuable disk space but also add unnecessary code to your WordPress site. It’s essential to regularly review your installed themes and plugins and remove those you no longer need. To do this:

  1. Log in to your WordPress admin dashboard.
  2. Navigate to “Appearance” -> “Themes” and delete any inactive themes.
  3. Go to “Plugins” -> “Installed Plugins” and deactivate or uninstall any unused plugins.

Remember to carefully consider the functionality and impact of each theme or plugin before removal to avoid any unintended consequences. It is also worth keeping one default WordPress theme installed such as the 2023 theme. Although not activated and in use, having a fall back default theme can help in checking for bugs if your site is broken.

2. Minify CSS and JavaScript

Minifying CSS and JavaScript files involves removing unnecessary characters (such as whitespace and comments) from the code, reducing its file size. This process helps optimise the delivery of CSS and JavaScript, resulting in faster page loading times.

To minify CSS and JavaScript files and speed up your WordPress site, you can use plugins like Autoptimize or W3 Total Cache. These plugins automatically optimise your files by combining, minifying, and caching them, ensuring an efficient delivery to your visitors.

3. Optimise Images

Images often contribute to the bulk of a web page’s size. Optimising images can significantly reduce the overall file size allowing you to easily speed up your WordPress site. There are several approaches to image optimisation:

  • Compressing images: Reduce the file size of images without compromising their quality. Plugins like Smush and ShortPixel can handle this task efficiently.
  • Lazy loading: Load images as the user scrolls down the page, rather than all at once. This technique improves initial page load times, especially for content-rich pages. The Lazy Load by WP Rocket plugin is a popular choice for implementing this functionality.
  • Proper image dimensions: Ensure that the dimensions of your images match the dimensions they will be displayed in. Uploading images with larger dimensions than necessary can lead to unnecessary data transfer.

4. Enable Gzip Compression

Gzip compression reduces the size of files sent from the server to the browser, resulting in faster page loading times. By enabling Gzip compression, you can significantly decrease the amount of data transferred and improve your website’s performance. To enable Gzip compression, add the following code to your site’s .htaccess file:

AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE font/opentype
AddOutputFilterByType DEFLATE font/otf
AddOutputFilterByType DEFLATE font/ttf
AddOutputFilterByType DEFLATE image/svg+xml
AddOutputFilterByType DEFLATE image/x-icon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml

Please note that modifying the .htaccess file requires caution. Make sure to create a backup before making any changes and consult with your hosting provider if necessary.

5. Utilise a Content Delivery Network (CDN)

A Content Delivery Network (CDN) distributes your website’s static content, such as images, CSS, and JavaScript files, across multiple servers worldwide. By doing so, CDNs minimise the physical distance between your visitors and your website’s files, resulting in faster load times. Popular CDNs include Cloudflare, StackPath, and Amazon CloudFront.

Integrating a CDN with WordPress is relatively straightforward. Many CDN providers offer dedicated plugins or integration guides to assist you with the setup process. Installing and configuring a CDN can significantly speed up your WordPress site and boost your website’s performance and help provide a seamless experience for your visitors.

Speed up your WordPress site with Asset Cleanup Pro: A Step-by-Step Tutorial

Asset Cleanup Pro is a powerful plugin designed to optimise your WordPress website by selectively unloading unnecessary CSS and JavaScript files. Our expert WordPress developers frequently perform WordPress speed optimisation work for clients and after caching plugins, Asset Cleanup Pro is the next plugin we install.

To speed up your WordPress site with Asset Cleanup Pro you can follow the steps below.

Step 1: Install and Activate Asset Cleanup Pro

To begin, you need to install and activate the Asset Cleanup Pro plugin. Follow these steps:

  1. Log in to your WordPress admin dashboard.
  2. Navigate to “Plugins” -> “Add New.”
  3. Search for “Asset Cleanup Pro.”
  4. Click “Install Now” and then “Activate” once the installation is complete.

Step 1: Install and Activate Asset Cleanup Pro

If you haven’t already installed and activated Asset Cleanup Pro, refer to Step 1 in the previous tutorial section for instructions on how to do so.

Step 2: Access Asset Cleanup Pro Settings

Once Asset Cleanup Pro is activated, navigate to the “Asset Cleanup” menu in your WordPress dashboard and click on it to access the plugin’s settings.

Step 3: Analyse Your Website’s Pages

In the Asset Cleanup Pro settings, go to the “Analysis” tab. Here, you will find an option to analyse your website’s pages in more detail. Click on the “Analyse Pages” button to begin the analysis process.

Asset Cleanup Pro will now scan your website and generate a comprehensive report of all the CSS and JavaScript files used on each page and post type. This detailed analysis will help you identify the specific code that can be unloaded to optimise the speed of your site.

Step 4: Unload Unnecessary Code on a Page-by-Page Basis

Speed up your WordPress website

After the analysis is complete, go to the “Unload on Pages” tab in the Asset Cleanup Pro settings. Here, you will see a list of all your website’s pages along with the CSS and JavaScript files loaded on each page.

Scroll through the list and review the files associated with each page. Uncheck the boxes next to the files that you deem unnecessary for specific pages. For example, if a particular page doesn’t require a specific CSS or JavaScript file, you can unload it to reduce the file size and improve loading speed for that specific page.

Once you have made your selections, click the “Save Changes” button to apply the changes.

Step 5: Unload Unnecessary Code on a Post-Type-by-Post-Type Basis

Asset Cleanup Pro allows you to unload unnecessary code based on different post types, such as posts, pages, custom post types, and more. To leverage this feature, go to the “Unload on Post Types” tab in the plugin’s settings.

In this tab, you will find a list of your website’s post types and the associated CSS and JavaScript files loaded for each type. Similar to the page-by-page unloading process, review the files and uncheck the boxes next to the unnecessary code for specific post types.

By unloading unnecessary code on a post-type-by-post-type basis, you can fine-tune the performance of your website and optimise the code loaded for different types of content.

Step 6: Test and Monitor Your Website’s Performance

After unloading unnecessary code using Asset Cleanup Pro, it’s crucial to test your website’s performance and monitor the impact of the changes. Use tools like Google PageSpeed Insights or GTmetrix to measure and analyse your site’s speed and make sure that the optimisations have positively affected its performance.

Regularly monitor your website’s speed and make adjustments as needed. Asset Cleanup Pro provides you with the flexibility to load or unload code as your site evolves and requirements change.


What are the benefits of using Asset Cleanup Pro?

Asset Cleanup Pro offers several benefits, including improved website performance, faster loading times, reduced HTTP requests, and enhanced user experience. By selectively unloading unnecessary code, you can optimise your WordPress site and provide a seamless browsing experience for your visitors.

Can Asset Cleanup Pro break my website?

Asset Cleanup Pro is a powerful tool, but it must be used with caution. Carefully review the files you choose to unload and ensure that they are not essential for your site’s functionality. Always test your website after making changes to verify that everything works as expected.

Are there any alternatives to Asset Cleanup Pro?

While Asset Cleanup Pro is an excellent choice for optimising your WordPress site, there are alternative plugins available. Some popular options include WP Rocket, Autoptimize, and WP Fastest Cache. Each plugin has its unique features and benefits, so it’s recommended to explore and compare them to find the one that best suits your needs.

Is Asset Cleanup Pro compatible with other caching plugins?

Yes, Asset Cleanup Pro is compatible with most caching plugins. However, it’s essential to configure the caching plugin properly to ensure that it doesn’t interfere with Asset Cleanup Pro’s functionality. Refer to the documentation of both plugins for specific instructions on integration and configuration.

Can I undo changes made by Asset Cleanup Pro?

Yes, Asset Cleanup Pro allows you to undo changes easily. In the plugin’s settings, navigate to the “Unused files” tab and recheck the boxes next to the files you want to restore. Click “Save Changes,” and the unloaded files will be loaded again on your website.


In this guide showing you how to Speed up your WordPress site, we explored the importance of speed for your WordPress site and provided valuable insights into unloading unnecessary code to enhance its performance.

We discussed various techniques, such as removing unused themes and plugins, minifying CSS and JavaScript, optimising images, enabling Gzip compression, and utilising a Content Delivery Network (CDN). Furthermore, we provided a step-by-step tutorial on how to use Asset Cleanup Pro, a powerful plugin that simplifies the process of unloading unnecessary code.

By implementing the techniques outlined in this guide and leveraging the capabilities of Asset Cleanup Pro, you can significantly speed up your WordPress site, enhance user experience, and achieve better search engine rankings.

Remember to regularly assess your website’s performance, stay updated with the latest optimisation practises, and continually optimise your site to maintain its speed and efficiency.

So don’t wait any longer—speed up your WordPress site now, unleash the full potential of your WordPress site, and provide your visitors with a lightning-fast browsing experience!

Looking for help to speed up your WordPress site?

If your WordPress site is loading slowly and you are looking for help to speed up your WordPress site, why not contact our expert WordPress developers? We have optimised hundreds of websites for speed and if you want to speed up your WordPress site we can get started right away.

To learn more about our WordPress speed optimisation services and how it can help to speed up your WordPress site, drop us an email or call us on 0421 033 433 and we will have your website performing like never before within hours.

Get Started

Ready to get going? Click on one of the buttons below and tell us more about the web design, web development or website fix you need and we will be in touch with you within hours with some options to get your business moving in the right direction