Skip to content

Instantly share code, notes, and snippets.

@WebEndevSnippets
Created April 16, 2013 18:59
Show Gist options
  • Save WebEndevSnippets/5398594 to your computer and use it in GitHub Desktop.
Save WebEndevSnippets/5398594 to your computer and use it in GitHub Desktop.
WooCommerce: Remove all WooCommerce scripts and styles
add_action( 'init', 'we_manage_woo_styles', 99 );
define( 'WOOCOMMERCE_USE_CSS', false );
/**
* Remove all WooCommerce scripts and styles
*
* @author WP Smith
* @since 1.0.0
*/
function we_manage_woo_styles() {
if ( 'product' !== get_post_type() && !is_page( 'cart' ) && !is_page( 'checkout' ) ) {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
remove_action( 'wp_enqueue_scripts', array( $GLOBALS['woocommerce'], 'frontend_scripts' ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment