Skip to content

Instantly share code, notes, and snippets.

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 bewho/959849d83a64fd5d0658f583756af8cf to your computer and use it in GitHub Desktop.
Save bewho/959849d83a64fd5d0658f583756af8cf to your computer and use it in GitHub Desktop.
Remove ALL WooCommerce scripts and styles.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php
/**
* Remove all WooCommerce scripts and styles! Forever!
*
* @author WP Smith
* @since 1.0.0
*/
function grd_remove_woocommerce_styles_scripts() {
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
remove_action( 'wp_enqueue_scripts', array( $GLOBALS['woocommerce'], 'frontend_scripts' ) );
}
define( 'WOOCOMMERCE_USE_CSS', false );
add_action( 'init', 'grd_remove_woocommerce_styles_scripts', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment