How to Disable Default WooCommerce Stylesheet?

By default, WooCommerce plugin enqueues three different stylesheets. You can remove these styles, by adding the following code snippet to your functions.php file.

See Also: Declare WooCommerce support in third party theme

add_filter( 'woocommerce_enqueue_styles', '__return_empty_array' );

The above code will deregister all three stylesheets. If you want to remove a specific stylesheet, you can use the following code,

// Remove each style one by one
add_filter( 'woocommerce_enqueue_styles', 'jk_dequeue_styles' );
function jk_dequeue_styles( $enqueue_styles ) {
	unset( $enqueue_styles['woocommerce-general'] );	// Remove the gloss
	unset( $enqueue_styles['woocommerce-layout'] );		// Remove the layout
	unset( $enqueue_styles['woocommerce-smallscreen'] );	// Remove the smallscreen optimisation
	return $enqueue_styles;
}

// Or just remove them all in one line
add_filter( 'woocommerce_enqueue_styles', '__return_false' );

 

0 Comments

Leave a Comment.