Use the code PERFMATTERS for 10% off!

How to disable WooCommerce scripts and styles

When you have WooCommerce installed it by default loads its scripts and styles on every page of your WordPress site. This is definitely not great for performance. As you can see below on our test site, WooCommerce was loading 8 scripts on our home page, where we don’t even have any products.

WooCommerce scripts and styles
WooCommerce scripts and styles

Disable WooCommerce scripts and styles

In the Perfmatters plugin, you can disable WooCommerce scripts and styles everywhere except on product, cart, and checkout pages. Follow the steps below.

Step 1

Click into the Perfmatters plugin settings.

Perfmatters plugin settings
Perfmatters plugin settings

Step 2

Under the “Options” tab click on the “WooCommerce” sub-navigation menu.

Perfmatters WooCommerce options
Perfmatters WooCommerce options

Step 3

Toggle on “Disable Scripts.”

Disable WooCommerce scripts and styles
Disable WooCommerce scripts and styles

Step 4

Scroll down and click “Save Changes.”

Alternative method

We utilize the wp_dequeue_script and wp_dequeue_style functions. You could also use the built-in Script Manager to achieve the same results. However, the method above is much easier and quicker.

Was this article helpful?

Related Articles