Make WooCommerce faster by removing unused CSS and JavaScript assets [code example]

preview_player
Показать описание
This video shows you how to make WooCommerce websites faster by removing unused JS and CSS files that WooCommerce automatically loads.

I've prepared a code snippet you can simply copy and paste into your website that will remove those unused assets from any non-WooCommerce page on your site.

By default, Woo loads CSS and JS files on every page or post on your website - even if it is not necessary. Using this function, you will make WooCommerce faster by only loading the WooCommerce assets when they are needed.

👇 My Top Picks & Resources 👇

If you have any questions, please get in touch with me on one of these channels:
- Leave a comment here
- Tweet me @iamjankoch
Рекомендации по теме
Комментарии
Автор

This is pure gold! Dequeueing scripts you don't need is critical to performance tuning!

withmikes
Автор

thank you for this bro, I hope both sides of your pillow stays cold.

xotic
Автор

Thanks a lot, Jan!
Btw, do you think that code works well/correctly with the newest Woo versions too? I mean, the code is 3 Years old, and Woocommerce has changed significantly since then.

SinisaSinjori
Автор

This is great, would this work for Elementor? as Elementor loads or a lot of unnecessary css and js

mansblackbook
Автор

How to remove unused javasript from blog use tevtools

keyconcepts
visit shbcf.ru