How to remove the WooCommerce results count

How to remove the WooCommerce results count
67 Views
<?php
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
?>

And one more thing –  if you’re using StoreFront theme, you have to remove woocommerce_after_shop_loop action as well.

<?php
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );
?>

Sometimes this code may not work you, for example, when you’re using it inside a plugin. In that case wrap the code in after_setup_theme action hook.

<?php
add_action( 'after_setup_theme', 'cxc_after_setup_theme_callback' );
function cxc_after_setup_theme_callback() {
	remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
	remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );
}
?>

And also possible to hide it with CSS.

<style type="text/css">
		.woocommerce-result-count {
			display: none;
		}
	</style>

Was this article helpful?
YesNo

Leave a comment

Your email address will not be published.