# 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.

- Type: PHP
- Runs: Run everywhere
- Category: [WooCommerce](https://wpide.com/library/category/woocommerce/)
- Requires: WooCommerce
- Tags: woocommerce, shop, sorting
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/woo-remove-result-count-ordering/

## Code

```php
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 use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Remove the Result Count and Sorting Dropdown" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
