Skip to content

Instantly share code, notes, and snippets.

@wpchannel
Last active February 18, 2018 19:03
Show Gist options
  • Save wpchannel/956ba04f7f9b010a1f326705bc02cf44 to your computer and use it in GitHub Desktop.
Save wpchannel/956ba04f7f9b010a1f326705bc02cf44 to your computer and use it in GitHub Desktop.
function wpc_dequeue_woocommerce_styles_scripts() {
if (function_exists('is_woocommerce')) {
if (! is_woocommerce() && ! is_cart() && ! is_checkout() && ! is_account_page()) {
wp_dequeue_style('woocommerce-general');
wp_dequeue_style('woocommerce-layout');
wp_dequeue_style('woocommerce-smallscreen');
wp_dequeue_script('wc_price_slider');
wp_dequeue_script('wc-single-product');
wp_dequeue_script('wc-add-to-cart');
wp_dequeue_script('wc-cart-fragments');
wp_dequeue_script('wc-checkout');
wp_dequeue_script('wc-add-to-cart-variation');
wp_dequeue_script('wc-single-product');
wp_dequeue_script('wc-cart');
wp_dequeue_script('woocommerce');
wp_dequeue_script('jquery-blockui');
wp_dequeue_style('wcqi-css');
}
}
}
add_action('wp_enqueue_scripts', 'wpc_dequeue_woocommerce_styles_scripts');
@wpchannel
Copy link
Author

Updating for WC 3.0+

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment