Categories

Featured templates

WooCommerce. How to remove some options from the “sort-by” list

Elina Webb June 16, 2015
Rating: 5.0/5. From 1 vote.
Please wait...
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:

WooCommerce-How_to_remove_some_option_from_the_sort-by_list-1

You can check the steps listed below:

  1. Log into FTP/File Manager, go to wp-content/themes/themeXXXXX/includes folder to open custom-function.php file:

    WooCommerce-How_to_remove_some_option_from_the_sort-by_list-2
  2. 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 );
        

    WooCommerce-How_to_remove_some_option_from_the_sort-by_list-3

    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.

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

    WooCommerce-How_to_remove_some_option_from_the_sort-by_list-4

Feel free to check the detailed video tutorial below:

WooCommerce. How to remove some options from the “sort-by” list
This entry was posted in WooCommerce Tutorials and tagged option, order, sort, WooCommerce. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket