Home › Forums › Main Forum › Theme Suggestion Box › How to remove all woocommerce stuff
My page loads styles and scripts for woocommerce although I don’t need it. How can I turn that off and avoid using unnecessary bandwidth?
Hi Daniel,
To remove styles and scripts of woocommerce please add this following code in functions.php file of child theme
/**
* Dequeue the jQuery and css of woocommerce
*
* Hooked to the wp_enqueue_scripts action, with a late priority (100),
* so that it is after the script was enqueued.
*/
function puresimple_child_dequeue_script() {
wp_dequeue_style( 'puresimple-woocommerce');
wp_dequeue_script('woocommerce-zoom');
}
add_action( 'wp_enqueue_scripts', 'puresimple_child_dequeue_script', 100);
Note: please use child theme to add this code, otherwise your changes will be lost on theme update.
Thanks
With our premium themes, we offer access to site documentation, video tutorials and timely support. Even if you have just started on WordPress, our support staff have the patience to help you create appealing sites gracefully.
Company
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.To find out more, including how to control cookies, see here: Privacy Policy
© Copyright © 2023 Styled Themes. All Right Reserved.