Skip to content

Instantly share code, notes, and snippets.

@gregrickaby
Last active January 2, 2019 10:38
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gregrickaby/2852142 to your computer and use it in GitHub Desktop.
Save gregrickaby/2852142 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