WooCommerce. How to remove some options from the “sort-by” list This tutorial will show you how to customize the default sorting/order-by dropdown list in Wocommerce

undefined

You can check the following steps:

Log on to the FTP / file manager, enter wp-content / themes / themeXXXXX / include folder, open a custom function.php file:

undefined

Add this code to the bottom of custom-function.php file, before the closing code ?>

 

// Edit WooCommerce dropdown menu item of shop page//
// Options: menu_order, popularity, rating, date, price, price-desc
 
function my_woocommerce_catalog_orderby( $orderby ) {
    unset($orderby["price"]);
    unset($orderby["price-desc"]);
    return $orderby;
}

add_filter( “woocommerce_catalog_orderby”, “my_woocommerce_catalog_orderby”, 20 );

 

undefined

  1. Each unset($orderby[“field_from_Options”]); will remove the section that you need, just replace field_from_Options with the field you need.

    You can choose the field name from the following options: menu_order, popularity, rating, date, price, price-desc.

  2. Save the file and refresh the site to see the changes:

undefined