How to Remove Default Product Sorting WooCommerce

Remove Default Product Sorting Are you looking for a quick way to remove the default product sorting in WooCommerce? This brief tutorial will provide a solution to this problem. If you have using  WooCommerce to building your online store, you have obviously seen the default sorting drop-down menu that is in the Shop and Archive Pages.

If you don’t want to have this default sorting feature on your store, it is possible to remove it using a simple code snippet I will share in this  post.

Remove Default Product Sorting WooCommerce

In the past I have dealt with many requests to help remove the WooCommerce default sort. In this article, I will share y two different solutions to remove this default sorting  feature. If you do not need to select that box or want to improve customer experience on your online store, then you need to remove it. The default shop page looks like this  on the storefront theme:Remove Default Product Sorting WooCommerce default look with the product sorting

In this post, I will provide a PHP snippet that will add the function to remove this drop down entirely from all the pages of your WooCommerce store.

However, you can use CSS to remove the default product sorting in WooCommerce, but PHP provides a simple and cleaner result.

Additionally, you do not have to have good coding experience to implement this solution, as you just have to copy the code and paste it in the functions.php file of your theme. Moreover, if you are a WordPress and WooCommerce beginner, I recommend using the plugin that I have included as another solution for removing the default sorting.

Without wasting much time on the introduction, let us have a look at the steps that you need to follow to remove the default product sorting in WooCommerce.

a)    Steps to Remove the Default Sorting Drop down in the WooCommerce Shop and Archive Pages

Here are the steps that you need to follow:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. From the Dashboard menu, click on Appearance Menu > Theme Editor Menu. When the Theme Editor page is opened, look for the theme functions file where we will add the function that will remove the default sorting drop down in the WooCommerce Shop and Archive pages.
  3. Add the following code to the PHP file:
/**
* @snippet Remove "Default Sorting" Dropdown @ WooCommerce Shop & Archive Pages
*/

add_action( 'init', 'njengah_remove_default_sorting_storefront' );

function njengah _remove_default_sorting_storefront() {
   remove_action( 'woocommerce_after_shop_loop', 'woocommerce_catalog_ordering', 10 );
   remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 10 );
}
  1. To see the outcome, simply refresh the page and you should see this:Shop page without the product sorting

How the Code Works

In the PHP Snippet above, I have created a function that will remove the default sorting drop-down in the WooCommerce Shop and Archive pages. Then we use a hook that will target the section before the shop loop and after the shop loop and remove the drop down.

b)    Steps to Remove the Default Sorting Drop down in the WooCommerce Using a Plugin

In this section, we will implement the same solution using a plugin called WooCustomizer that has a free and pro version, which has a 14-day money-back guarantee.WooCustomizer Plugin

This solution is for those who are not too confident with PHP. This is why I added this solution so that everyone can achieve the same result, whether you are a developer or a WordPress beginner. I chose this plugin because it has many positive reviews and has more than 10,000 active installations in the WordPress Community. It has a quality code that has been tested and is updated frequently to remove any bugs. Moreover, it is actively developed by the people who are active supporters of the WordPress ecosystem.

Additionally, it can be downloaded here using this link . It is available at WordPress repository. To use this plugin to remove the default sorting feature, just follow these simple steps:

  1. Log into your WordPress site and access the Dashboard as the admin user.
  2. Then, we are going to install the plugin that we have indicated earlier. If you have downloaded it using the link above, simply navigate to Plugins > Add New. After that, click on Upload Plugin and then Browse for the downloaded file as shown below:installing the downloaded plugin
  3. To download it directly in the Admin Panel, simply navigate to Plugins > Add New. After that, you will need to do a keyword search for the plugin ‘WooCustomizer’. You need to install and activate it as shown below:installing the plugin directly
  4. After activating the plugin, click on WooCommerce > WooCustomerzer.
  5. Click on Try out WooCustomizer Pro Settings as shown below:try out pro version
  6. You need to log into your WordPress site to see the changes that you make. To remove the Default Sorting Dropdown in the WooCommerce, click on WooCustomizer > WooCommerce Shop Page and click on Remove Shop Sorting Dropdown as shown below:                                            plugin settings
  7. The outcome will be:Shop page without the product sorting

Conclusion

We have removed the default WooCommerce Product sorting feature using two methods. The first one involves the use of a PHP code snippet that provides a simple yet clean solution. The second solution involves the use of a plugin, which has a 14 –day trial period after which you will have to purchase the full version. However, I will recommend using the use of the PHP snippet as it does not involve many steps, plus it is free. I hope that this post provided a solution to removing the default sorting feature in WooCommerce shop page.

Similar Articles

 

Comments are closed.