48
This is quite an annoying thing in WooCommerce when you have just a few products.
Besides, if you only have 1 product in a given category, the notice “Showing the Single Result” will appear on top of the category page.
So, how do we remove the whole “Showing 1–15 of 178 results” element from the Shop, Category, Tag and product loop? Here’s the fix. enjoy!
PHP Snippet 1: Remove “Showing xyz results” @ WooCommerce Shop
In this case we want to remove “Showing the Single Result” but also the other notice that says “Showing x – x of x results”. Basically, the whole element.
/**
* @snippet Remove "Showing x results" - WooCommerce
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 5
* @donate $9 https://tutoraspire.com
*/
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
PHP Snippet 2: Remove “Showing xyz results” in Storefront Theme
/**
* @snippet Remove "Showing x results" Storefront Theme - WooCommerce
* @how-to Get tutoraspire.com FREE
* @author Tutor Aspire
* @compatible WooCommerce 5
* @donate $9 https://tutoraspire.com
*/
add_action( 'init', 'tutoraspire_delay_remove_result_count' );
function tutoraspire_delay_remove_result_count() {
remove_action( 'woocommerce_after_shop_loop', 'woocommerce_result_count', 20 );
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
}