Skip to content

Instantly share code, notes, and snippets.

@MarkoSh
Last active February 11, 2018 09:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkoSh/a00a526fd0b62d68ed20dddde8e74002 to your computer and use it in GitHub Desktop.
Save MarkoSh/a00a526fd0b62d68ed20dddde8e74002 to your computer and use it in GitHub Desktop.
WooCommerce total disable
add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );
add_action( 'wp_head', 'disable_woo', 99 );
function disable_woo() {
global $wp_scripts, $wp_styles;
$scripts = array(
'accounting',
'wc-jquery-ui-touchpunch',
'wc-price-slider',
'flexslider',
'js-cookie',
'jquery-blockui',
'jquery-cookie',
'jquery-payment',
'photoswipe',
'photoswipe-ui-default',
'prettyPhoto',
'prettyPhoto-init',
'select2',
'selectWoo',
'wc-address-i18n',
'wc-add-payment-method',
'wc-cart',
'wc-cart-fragments',
'wc-checkout',
'wc-country-select',
'wc-credit-card-form',
'wc-add-to-cart',
'wc-add-to-cart-variation',
'wc-geolocation',
'wc-lost-password',
'wc-password-strength-meter',
'wc-single-product',
'woocommerce',
'zoom'
);
foreach ( $scripts as $script ) {
wp_dequeue_script( $script );
wp_deregister_script( $script );
}
$styles = array(
'photoswipe',
'photoswipe-default-skin',
'select2',
'woocommerce_prettyPhoto_css',
'woocommerce-layout',
'woocommerce-smallscreen',
'woocommerce-general'
);
foreach ( $styles as $style ) {
wp_dequeue_style( $style );
wp_deregister_style( $style );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment