How To Delete Sort By Popularity On Woocommerce

How to Delete “Sort by Popularity” from WooCommerce Product Ordering

Are you Discover insights on Customcat How To Create Mockups Woocommerce tired of the “Sort by Popularity” Discover insights on How To Remove Woocommerce Pages From Primary Menu option cluttering your WooCommerce product pages? This comprehensive guide will show you how to remove this sorting option and streamline your customer’s shopping experience. While popularity sorting can be useful, it might not align with your specific sales strategy or website design. This article will guide you through various methods, ranging from simple plugin modifications to custom code solutions.

Understanding WooCommerce Sorting Options

Before diving into the removal process, it’s essential to understand how WooCommerce handles product sorting. By default, WooCommerce Explore this article on How To Change Size Of Woocommerce Email Header Image offers several sorting options, including:

    • Featured: Shows featured products first.
    • Best selling: Sorts products by sales count.
    • Average rating: Sorts by customer reviews.
    • Newness: Sorts by product upload date.
    • Price: Sorts by price (low to high or high to low).
    • Popularity: Sorts by product views.

The “Sort by Popularity” option is often included, but its usefulness depends on your individual needs and website goals.

Methods to Remove “Sort by Popularity” in WooCommerce

There are several ways to achieve this, each with varying levels of complexity:

#### Method 1: Using a Plugin (Easiest Method)

The simplest and most recommended approach is using a WooCommerce plugin specifically designed to manage sorting options. Many plugins offer granular control over the available sorting options, allowing you to easily remove “Sort by Popularity” without touching any code. Search the WordPress plugin directory for plugins like “WooCommerce Product Sorting” or “WooCommerce Advanced Ordering”. These plugins typically offer a user-friendly interface to enable or disable specific sorting options.

#### Method 2: Modifying the `woocommerce_get_catalog_ordering_args` Filter (Intermediate)

This method involves using a code snippet to modify the default sorting options. This requires familiarity with WordPress’s filter system. Add the following code snippet to your theme’s `functions.php` file or a custom plugin:

 add_filter( 'woocommerce_get_catalog_ordering_args', 'remove_popularity_sorting' ); function remove_popularity_sorting( $args ) { unset( $args['orderby'] ); // Remove the default orderby value $args['orderby'] = 'date'; //You can change to 'menu_order','title','price' etc. $args['order'] = 'desc'; //Set order as descending // Remove popularity from orderby array. $orderby_options = array( 'menu_order' => __( 'Default sorting', 'woocommerce' ), 'popularity' => __( 'Sort by popularity', 'woocommerce' ), 'rating' => __( 'Sort by average rating', 'woocommerce' ), 'date' => __( 'Sort by newness', Check out this post: How To Make Woocommerce Website Faster Free 'woocommerce' ), 'price' => __( 'Sort by price: low to high', 'woocommerce' ), 'price-desc' => __( 'Sort by price: high to low', 'woocommerce' ), ); unset($orderby_options['popularity']); $args['orderby_options'] = $orderby_options; return $args; } 

This code snippet removes the “popularity” option from the available sorting options and sets the default to sorting by date descending. Remember to back up your files before making any code changes.

#### Method 3: Child Theme (Advanced)

Creating a child theme is a safer alternative to modifying your theme’s `functions.php` file directly. This method involves creating a separate theme that inherits from your current theme, allowing for updates without overwriting your customizations. Place the code snippet from Method 2 within your child theme’s `functions.php`.

Conclusion

Removing the “Sort by Popularity” option in WooCommerce can be Discover insights on How To Enable Geolocations Woocommerce achieved through various methods, ranging from simple plugin installation to custom code modifications. Choose the method that best suits your technical skills and comfort level. Remember to always back up your website before making any significant changes. By streamlining your sorting options, you can create a more focused and efficient shopping experience for your customers. If you are not comfortable with code modification, the plugin method is the safest and easiest approach.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

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