# Simplify the Shop Sorting Dropdown

> Removes sorting options you do not need from the shop's "Sort by" menu and lets you rename the ones that remain.

- 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-trim-sorting-options/

## Code

```php
add_filter( 'woocommerce_catalog_orderby', function ( $options ) {
    // Options to remove.
    $remove = array( 'rating' );

    // Option => new label.
    $rename = array(
        'date'       => 'Newest first',
        'price'      => 'Price: low to high',
        'price-desc' => 'Price: high to low',
    );

    foreach ( $remove as $key ) {
        unset( $options[ $key ] );
    }

    foreach ( $rename as $key => $label ) {
        if ( isset( $options[ $key ] ) ) {
            $options[ $key ] = $label;
        }
    }

    return $options;
}, 20 );
```

## Notes

Available keys are menu_order, popularity, rating, date, price and price-desc.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Simplify the Shop 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/
