How to Remove the Orderby Dropdown for Products in WooCommerce

While working on a recent customization for a WooCommerce site, I had a little difficulty tracking down exactly where the orderby drop down that appears above product listings lives in the code.  Since I didn’t find a blog post addressing this directly, I thought I would share what I figured out.

To remove the drop down and ordering options completely, add the following to your functions.php file:

remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );

Some folks have commented that this works for them:

remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 20 );

However, if you want to edit the drop down and make it something else.  You can find the file at the following location:

/wp-content/plugins/woocommerce/template/loops/ordering.php

You can then copy that file to your theme folder, edit it, and override the default drop down.

/wp-content/themes/yourtheme/woocommerce/loops/ordering.php

Hope this helps anyone who gets stuck looking for how to remove the Orderby drop down on WooCommerce listing pages.

15 thoughts on “How to Remove the Orderby Dropdown for Products in WooCommerce

  1. Hi, i try it and doesnt work for me, i use this:

    .orderby{
    display:none;
    }

    It hide the drop down but dont delete it. Do you know why the code doent work for me?

    Thanks!

    Like

    1. Any idea on how to remove the ‘Show X Products’ dropdown?

      I tried
      .woocommerce-result-count {
      display: none;
      }

      and that did not work.

      Like

  2. Thanks, I was figuratively pulling my hair out with this, when I’ve found your post; I was using the same code, with one exception: ’20’ instead of 30 at the end of the string
    I have no idea why that matters, to my shame 🙂

    Thanks a lot !

    Like

  3. Hello guys,

    Im still trying to remove de sort menu but still nothing. I added the string on functions.php:
    remove_action( ‘woocommerce_before_shop_loop’, ‘woocommerce_catalog_ordering’, 30 );

    and nothing happens.

    Im using wordpress 4.2.1, woocommerce 2.3.8 and Storefront 1.4.4.

    Please, any idea ?

    Like

  4. Just comment out the complete code (after <?php) in file
    yourpath/wp-content/plugins/woocommerce/templates/loop/orderby.php

    Did it in woocommerce version 2.3.9 and it works without php error. Keep the file if you want to use the orderby dropdown later.

    Like

  5. I used the after_setup_theme hook and priority 10 and it works for me (WooCommerce 2.3.10 and Storefront theme 1.4.5)
    Good luck!

    * remove default sorting dropdown in StoreFront Theme */
    function ssite_remove_catalog_ordering()
    {
    remove_action('woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10);
    remove_action('woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10);
    }
    add_action('after_setup_theme', 'ssite_remove_catalog_ordering', 1);

    Liked by 1 person

  6. Hi Szabesz,

    your option worked. Thanks.

    I put the code in the functions.php in the main theme editor and worked. Thanks mate.

    Like

  7. is it possible to force the custom ordering in code ? i know there is a option in woocommerce to force the default order type. Only in my webshop the mobile fuction doesnt listen to this option and still orders bij price acs. So i would like to force the product sorting order to custom sorting order. is this possible please help

    Like

Leave a comment