Making WooCommerce Faster By Removing Unused CSS/JS Files

 

In this video, I’ll show you how you can make WooCommerce faster by removing unused CSS and JavaScript files from pages where you’re not using Woo functionality.

Due to the way WooCommerce is built, it is loading its assets on every single piece of content on your website. That obviously is not ideal when you’re striving to build a fast-loading Woo website.

Therefore, I’ve recorded this quick screencast and given you this code example to fix the issue of WooCommerce loading unused CSS/JS files. You can open the code snippet on Github here: https://gist.github.com/jan-koch/544f858ae37e63ddf161243062f308fe

Please test this code on a staging website before adding it to the theme’s functions.php on your production website!

Due to the variety of WordPress themes and plugins (and since I don’t know how your site is built), the code might cause unwanted side effects.

Obviously, I’ve tested the code snippet and – as you can see in the video – it is working on my example website.

If you have any issues with the code, please get in touch with me. The best way to do that is to leave a comment on the YouTube video or join my FB group called WP Mastery.

 

Subscribe To My Weekly Newsletter

Get curated content on scaling WP agencies, wordPress Development, and more.

Liked this article? Please share it around!
Share on facebook
Facebook
Share on google
Google+
Share on twitter
Twitter
Share on linkedin
LinkedIn
Share on email
Email
More Content To Explore

Discover How Continuous Integration Saves Me 4-8h weekly.

Download this free PDF document to discover 5 benefits Continuous Integration can bring to your WP agency or freelance business.

Do NOT follow this link or you will be banned from the site!
small_c_popup.png

Receive weekly curated content for WP Agencies & Developers.

Scale Your WordPress Agency Without Drowning in Projects.

small_c_popup.png

Download your free Continuous Integration guide

5 reasons you should use automated deployments