Remove the Result Count and Sorting Dropdown
Hides "Showing 1-12 of 40 results" and the "Default sorting" menu above the products on shop and category pages.
Opens WPIDE on
Code
add_action( 'woocommerce_before_shop_loop', function () {
$remove_count = true; // Hide the result count.
$remove_sorting = true; // Hide the sorting dropdown.
if ( $remove_count ) {
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 );
}
if ( $remove_sorting ) {
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );
}
}, 1 );
Notes
Set either value to false to keep that element.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.