How to customize WooCommerce product sorting and ordering
As a business-savvy online store owner, you probably already know that the order in which WooCommerce products are sorted and displayed on the front-end is essential to the success of your e-commerce store. It directly influences which items capture the customer’s attention first.
Allowing customers to sort your product list in different ways is also important. It enables you to help prospective customers find the products they want to purchase quickly and easily.
Essentially, WooCommerce product sorting forms a central part of your store’s navigation structure alongside other on-page elements such as the menu, keyword search, and product filters.
In this article, you will learn how to customize WooCommerce sorting on your online store using built-in options. You’ll also learn how to add more advanced product sorting to your e-commerce store using the WooCommerce Product Table plugin. You can change the WooCommerce product order based on a wide range of sort criteria including product name, description, order by SKU, price, attribute, categories, tags, and more. Click here to find out more about sorting options in WooCommerce Product Table.
What product sort options are built into WooCommerce?
Out of the box, WooCommerce gives store owners some basic product sort options.
The Customizer

You can go to the Customizer → WooCommerce → Product Catalog to set the initial sort order of products in your online store using the WordPress Customizer. You can choose default sorting (custom ordering + name), popularity, average rating, most recent, and price.

Most WooCommerce-optimized themes display a basic sort dropdown at the top of the shop and category pages. Customers can use this to change the default sorting order by popularity, average rating, latest, price: low to high, and price: high to low.
The only problem is that the default product sorting options in WooCommerce are pretty limited. More specifically:
- You can only sort WooCommerce products by a very restrictive list of values. The default options let you sort by popularity, average rating, latest, price: low to high, and price: high to low.
- While you can choose how products are sorted, there’s no option to select the sort order.
- The default options don't improve the layout of your products or present them in a way that allows easy sorting or comparisons.
WordPress block editor
When you use any of the Products blocks in the Gutenberg block editor which comes with WordPress, you can choose the sort order. This controls the order of products when the page first loads.

Lots of store owners build their store pages using other page builders such as Elementor or Divi. That's fine - just check which modules they provide for displaying products, and look for sort options.
Shortcodes
Similarly, you can list WooCommerce products using shortcodes. Each shortcode includes options for controlling the initial sort order and direction of the products. You can learn all about these in our Complete guide to WooCommerce shortcodes.
Custom snippets
Developers can also use custom code to sort products programmatically. We'll explore this later in the post.
But what about letting customers sort products?
On the front end, WooCommerce itself displays a 'Sort Products' dropdown at the top of your main shop pages. For example, you'll see this on the Shop page, product category pages, etc. Customers can use this to sort by various data such as product name and price, in ascending or descending order.

Common WooCommerce product sorting issues
Product sorting is an essential feature in any WooCommerce store, but it doesn’t always work as expected. Here are some common issues you might encounter and how to address them:
1. Compatibility Issues with WordPress Themes
Some WordPress themes override WooCommerce’s default sorting options, which can cause unexpected behavior. For example:
- The displayed order of products can be mixed up.
- Custom sorting options might not work as intended.
Solution:
Check if your theme is fully compatible with WooCommerce. If issues persist:
- Test the default Storefront theme to confirm the problem lies with your current theme.
- Contact your theme developer for guidance or look for WooCommerce-specific themes.
2. Performance Problems with Large Product Catalogs
If your store has a large number of products, sorting can slow down your site. Sorting by price, popularity, or custom attributes requires database queries, which can strain server performance with bigger catalogs.
Solution:
- Use caching plugins like WP Rocket to reduce server load.
- Optimize your database using plugins like WP-Optimize.
- Limit the number of products displayed per page to improve loading times.
- Consider upgrading to a hosting plan designed for WooCommerce stores.
As you can see, there are limitations with the default sorting options. Most of them focus on letting store managers control the sort order, not on allowing customers to re-order products.
Thankfully, there’s a better way to let customers sort products on the front-end.
Product Table - the perfect WooCommerce product sorting plugin
The WooCommerce Product Table plugin provides a more flexible and effective way to sort products.
You can enable product tables globally on your shop and category pages. Alternatively, you can insert custom product tables using a shortcode to any page you’d like. This provides a better, more intuitive way to sort products throughout your store in just a few minutes.
Whether you're looking for a WooCommerce sort products by attribute plugin or a way to sort in a particular order, WooCommerce Product Table makes it easy.
Why use WooCommerce Product Table for product sorting?
- Better layout. Instead of the basic grid layout that comes out of the box with WooCommerce, the WooCommerce Product Table plugin lets you list products in an intuitive, user-friendly table layout with multiple columns of information. This naturally lends itself to sorting WooCommerce products in a variety of different ways.
- Tons of sorting options. WooCommerce Product Table lets you sort by many, many different types of product data. You can sort by product name, attribute, menu order, product ID, SKU, custom fields, price, popularity, reviews, date, and last modified date. In addition, you can also choose to sort products by any column in the table, or even randomly.
- Set the sort order. For each sorting option, the WooCommerce Product Table plugin lets you choose the sort order using the
orderby
option. You can choose to sort the products either in ascending order or descending order. For example, you can sort products by product name in ascending order i.e. alphabetical sorting. This way, customers can quickly find products alphabetically. - Date sorting. As well as alphabetical sorting, you can set any column as a date column so that it is sorted correctly by date.
- Numeric sorting. You can also set columns as number columns so that they can be sorted numerically.
- Customers can sort products. You can set the initial sort order for your products i.e. the default sort order when the page first loads. In addition, this WooCommerce sort products plugin also lets customers sort the products in ascending order or descending (or date or number) order simply by clicking on any of the table column headers.
- Bonus options. The column sorting in WooCommerce Product Table works perfectly alongside the plugin’s other features which help prospective customers find products quickly and easily. These include the instant AJAX search box, the ability to choose the number of products per page, and WooCommerce product filters.
With the best WooCommerce product table plugin, column sorting happens automatically as soon as you activate the plugin on your WordPress website. You can use the plugin options to change this as required.
How to set up product sorting
Once you have the WooCommerce Product Table plugin installed and activated on your WordPress website, you can set up WooCommerce product sorting. There are two ways to do this:
Method 1: Configure WooCommerce product sorting globally for all products
The Product Table plugin makes it easy to set the WooCommerce product sorting options for all products on a global basis:
- Get the WooCommerce Product Table plugin and download the zip file from the confirmation email.
- Go to Plugins → Add New and activate the plugin on your WordPress site.
- The table builder will open when you first activate the plugin. You can also re-open it later via Products → Product Tables → Add New.
- Follow the steps in the table builder to set up your table. On the first page, select the option to 'Display on a shop page'.
- Next, select which of your WooCommerce shop pages you will display the sorted products on. To do it globally, choose all of them:
- Go through the next few pages to choose details such as which columns to include in the table, how you want the add to cart buttons to look, and so on.
- On the 'Sort' page, choose the product sorting and sort direction. You can set the initial sort order to:
- Default WooCommerce order. (This is the order that you set by going to Add/Edit Product → Product Data → Advanced for each product. Products with the lowest order are listed first, e.g. "0" comes first.)
- ID.
- Date published.
- Date modified.
- Popularity (sales).
- Average rating.
- Image.
- Summary.
- Stock.
- Price.
Advanced sort options
The 'Other' option lets you sort products by any column in the table. Keep in mind that this only works if lazy load is disabled. The available columns are:
- SKU - Order products by their unique SKU code.
- ID - Sort products by database ID.
- Name - Order products by name or title.
- Description - Order products by the first word of the main description.
- Short-description - Sort products by the first word of the short description.
- Date - Order products by published date.
- Categories - Sort by WooCommerce product category.
- Tags - Order products by tag.
- Reviews - Order products by average rating.
- Stock - Sort products by stock status or number of products in stock. (This depends on the inventory settings in your wide WooCommerce store.)
- Weight - Order products by weight, e.g. lightest or heaviest first.
- Dimensions - Order products by their dimensions, e.g. size starting with the smallest first.
- Price - Order products by price.
- Product attribute - Sort WooCommerce products by attribute, e.g. size. To do this, add att: in the 'Sort column' field followed by the attribute slug, e.g.
att:size
. - Custom field - Sort WooCommerce products by custom field values, e.g. a 'Reference' custom field column. To do this, add cf: in the 'Sort column' field followed by the custom field name, e.g.
cf:reference
. - Custom taxonomy term - Sort WooCommerce products by custom taxonomy terms, e.g. a taxonomy called 'Brand'. To do this, add tax: in the 'Sort column' field followed by the custom field name, e.g.
tax:brand
.
Change the WooCommerce sort direction
Once that’s done, use the Sort direction option to set the sort order. You can choose:
- Automatic
- Ascending (A to Z, 1 to 99)
- Descending (Z to A, 99 to 1)
Once you've finished creating the table, it will appear on the relevant WooCommerce shop page like this:

Method #2: Configure WooCommerce product sorting for selected items
If you sell different types of products then you might want to sort some products in one way and others in another way. For example, you might order clothes by Menu order and shoes by Price.
This is possible with the WooCommerce Product Table plugin. All you have to do is create multiple tables and add them to different pages, instead of setting the sort options globally on your default store pages.
Setup instructions
Repeat these instructions for each set of products that you want to sort differently:
- Navigate to Plugins → Add New in your WordPress dashboard and install the WooCommerce Product Table plugin.
- Upon activation, the table builder will launch automatically. You can find it later at Products → Product Tables → Add New.
- Use the table builder wizard to configure your product table settings. On the first page, select the option to "Add to a page using a block or shortcode".
- On the 'Select your products' page, choose one of the categories that you wish to customize the product sorting for.
- Complete the remaining steps as needed, including choosing the WooCommerce product sorting order and sort direction.
- Copy the shortcode from the final page of the wizard.
- Go to the page where you want to list the products from the category you selected above. Either paste the shortcode or add a 'Product Table' Gutenberg block and select the table.
- Finally, install the free Redirection plugin and redirect your original category page to the new page you created. You can do this at Tools → Redirection. This will avoid people seeing the products sorted in the wrong way.
- Repeat steps 2-8 for all the categories that you want to sort in different ways.
Checking the product sort order
View your newly sorted product categories and you will see the products listed in a table with your customized sort order. For example, the Clothes category might look like this, sorted by the default WooCommerce order:

And the Shoes category might look like this, sorted by price:

Customers can click on the column headings to change how the products are sorted as required.
Bonus: Re-order products using the menu order
The WooCommerce Product Table plugin lets you sort products by menu order. This gives you granular control over the order of products on your main shop page. You can set the menu order for your WooCommerce products directly from the WordPress back-end.

Go to WooCommerce → Products from the WordPress admin panel. Click on the Sorting tab. From here, you can simply drag and drop the products into place. The products that appear first in the list will appear at the top of the product table on the front end.
Bonus: Use a custom code snippet to sort products
Developers can also use custom code to sort products programmatically. WooCommerce have provided a useful article to get you started with this.
You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.
/** * Add custom sorting options (asc/desc) */ add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' ); function custom_woocommerce_get_catalog_ordering_args( $args ) { $orderby_value = isset( $_GET['orderby'] ) ? wc_clean( $_GET['orderby'] ) : apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby' ) ); if ( 'random_list' == $orderby_value ) { $args['orderby'] = 'rand'; $args['order'] = ''; $args['meta_key'] = ''; } return $args; } add_filter( 'woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby' ); add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby' ); function custom_woocommerce_catalog_orderby( $sortby ) { $sortby['random_list'] = 'Random'; return $sortby; }
Bonus: Enhance your customer's shopping experience with the WooCommerce Products Filter plugin
If you're reading this article on how to customize WooCommerce product sorting and ordering, chances are you're interested in making it easier for your customers to find and purchase the products they want. But did you know that you can also enhance your customers' shopping experience by using a WooCommerce Products Filter plugin?
The WooCommerce Products Filter plugin offers a wide range of filters to help customers narrow down their search for the perfect product. Customers can filter products by categories, attributes, color, tags, custom taxonomy, price, ratings, in-stock, and on-sale. What's more, the plugin allows you to display the filters in a variety of formats, including category dropdown lists, checkboxes, radio buttons, labels/tag clouds, images, or color swatches.
But that's not all. The WooCommerce Products Filter plugin also allows customers to choose how they want the list of results sorted. This means that they can filter and sort products based on their preferences, making it easier for them to find what they're looking for. By providing a more personalized and streamlined shopping experience, you can increase customer satisfaction and loyalty. So if you're looking to take your WooCommerce store to the next level, consider using a products filter plugin in addition to customizing your product sorting and ordering.
Where to get the product sorting plugin
The product sort options you get out of the box with the WooCommerce plugin are pretty basic.
Using the WooCommerce Product Table plugin, you can set the initial sort order and let customers sort products themselves in a variety of different ways. Plus, you’ll have the option to configure the sorting settings globally or on a per-category basis.
Ready to sort products on your WooCommerce store, increase product visibility, and boost sales? Get the WooCommerce Product Table plugin today.
8 Comments
Hi Maria
For Popularity order can we show Products based on the last 90 days sell?
Thanks
Hi, Vijay.
Thanks for asking about an option to sort products by "last purchased" (recently purchased on top). While we don't have any immediate plans to implement this, a few other people have previously requested this feature and we’re tracking the amount of demand to help us decide whether to prioritize it in future.
I have added your ‘vote’ to our feature request list, and we will let you know if we add this to a future version of the plugin. In the meantime, I'm sorry that this isn't possible.
Please let me know if you have any more questions. Cheers.
Hi! Can you add sorting by discount volume?
Hi, Nikolai. Thanks for asking. By default, WooCommerce only allows you to set a regular price and a sale price - and these are displayed in the price data field. Price and percentage discounts can be set by using a pricing plugin, and the price data field value displayed is usually the discounted price with the regular price crossed out.
What you would like to achieve is two-fold: First the discounted amount (e.g. $10 less) or percentage (e.g. 10%) needs to be displayed/included in the price field data value, and only then can a sorting function by this value be possible. I have added this to our feature request list so that we can track the amount of demand. We will let you know if we add this to a future version of the plugin.
In the meantime, I'm sorry that this isn't possible.
As an alternative or workaround, you could add/create the discount volume value as either a custom field or custom taxonomy and display it as a column in the product table, which you can then set the sorting by.
Please let me know if you have any more questions. Cheers!
Hi, Just wanted to ask, Can I still use the grid view but with the sorting functionalities of the plugin?
Hi Jo,
Thanks for your comment.
The sort option/feature of our plugin only appears within the product table, and cannot be used outside the table. WooCommerce itself comes with a sorting option on its own.
If it interests you, you can provide an option to your customers to switch between the default grid layout and the product table view (so they can use the functionality that comes with our plugin). To do this, please see Code Snippets - Switch Between Grid and Table View in Shop/Category Archive Pages.
I hope this helps! Let us know if you have any more questions/concerns. You may also reach us via our dedicated Support Center. Cheers!
Does your table do tables for shoes?
So each model shoe would be the row and the size attributes in each column
We need this for wholesale where customers are buying several sizes of each shoe.
YOur demos shoe shoes but no size attributes, which no one buys a shoe without the size.
Hi, Tim. You can achieve this by adding the size as a global product attribute and the different size as its terms in WooCommerce on your site, then use this for the product variations also in WooCommerce. Once this is set up, you can then use the available Product variations options to display the product and its variations in the product table on your site. You can see examples of this in our Product Table with Variations front-end demos (albeit we use hoodies and shirts in our demo, which you can do the same for shoes).
I hope this makes sense and helps. Should you have any more questions, you can also get in touch with us by enquiring via our dedicated Support Center. Thanks!