- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
WooCommerce. How to remove some options from the “sort-by” list
June 16, 2015
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:

You can check the steps listed below:
-
Log into FTP/File Manager, go to wp-content/themes/themeXXXXX/includes folder to open custom-function.php file:
-
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 );
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.
-
Save the file and refresh the site to see the changes:
Feel free to check the detailed video tutorial below:
WooCommerce. How to remove some options from the “sort-by” list