Menu Close

How to Remove the ‘Default Sorting’ Dropdown in WooCommerce

default

If you have the default sorting dropdown when using the default WooCommerce functionality and want to remove it, well, you’re in the right place.

Yes, we can remove this using CSS, but the better way would be to remove it by simply adding a snippet of code to your functions.php file.

How to Remove ‘Default Sorting’ Dropdown from WooCommerce Shop & Archive Pages


/**
 * Remove 'Default Sorting' Dropdown from WooCommerce Shop & Archive Pages
 *
 */
  
remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 );

Remove ‘Default Sorting’ Dropdown from WooCommerce in StoreFront Theme


/**
* Remove 'Default Sorting' Dropdown @ StoreFront Shop & Archive Pages
*/
  
add_action( 'wp', 'silva_remove_default_sorting_storefront' );
  
function silva_remove_default_sorting_storefront() {
   remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
   remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
}

Can it be done with a plugin?

If you don’t feel confident with PHP coding, no problem, there is a plugin called StoreCustomizer that will do just the trick.

With this plugin, you can hide the ‘default sorting’ dropdown and offers a lot more than this. Essentially, it’s a plugin built for everyone who wants to fully customise their WooCommerce store without coding (e.g. edit buttons, badges, tabs, pages, stock display, checkout fields).

View Source
Posted in WooCommerce