wc 8.5.2 loads a ton of unnecessary scripts
-
Hi – woocommerce 8.5.2 triggers a lot of unnecessary scripts.
Up to now i used:
add_action( 'template_redirect', 'remove_woocommerce_styles_scripts', 999 ); function remove_woocommerce_styles_scripts() { if ( function_exists( 'is_woocommerce' ) ) { if ( ! is_woocommerce() && ! is_cart() && ! is_checkout() ) { remove_action('wp_enqueue_scripts', [WC_Frontend_Scripts::class, 'load_scripts']); remove_action('wp_print_scripts', [WC_Frontend_Scripts::class, 'localize_printed_scripts'], 5); remove_action('wp_print_footer_scripts', [WC_Frontend_Scripts::class, 'localize_printed_scripts'], 5); } } }
This worked fine with versions prior to 8.5.2. With the newest release woocommerce triggers loading a ton of scripts on non-woocommerce pages: dom-react.min.js, compose.js, wp-polyfill-inert.min.js and many more. This has an impact on performance. How can i prevent woocommerce from triggering the loading of unnecessary scripts? regards to
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wc 8.5.2 loads a ton of unnecessary scripts’ is closed to new replies.