StyledThemes

How to remove all woocommerce stuff

Home Forums Main Forum Theme Suggestion Box How to remove all woocommerce stuff

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #16875

    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?

    #16876
    Sushil Adhikari
    Moderator

    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

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.