How to remove default sorting from Storefront shop loop

There are many reasons why you want to remove the default sorting functionality from the shop and the category page of the Storefront WooCommerce theme. Let’s say your shop sells only 10 products. Do you really need it then? Or maybe you want to write your own filter and sorting system for a shop.

So to remove the sorting just add the following code snippet to your (child-)themes functions.php:

add_action( 'init', 'tk_remove_default_storefront_sorting' );
  
function tk_remove_default_storefront_sorting() {

  // Removes sorting before product list
  remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );

  // Removes sorting after product list
  remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );

}

 

Leave a Comment

Your email address will not be published. Required fields are marked *