Website Building » WooCommerce » How Do I Sort Items Alphabetically in WooCommerce?

How Do I Sort Items Alphabetically in WooCommerce?

Last updated on January 18, 2023 @ 3:00 pm

WooCommerce is a popular eCommerce platform for WordPress. If you’re using WooCommerce to sell products on your website, you may want to alphabetize your products to make them easier for customers to find.

There are a few different ways to alphabetize products in WooCommerce. You can use a plugin, or you can edit your theme’s code.

Using a Plugin:

There are several plugins that can alphabetize your WooCommerce products. One popular option is the “Alphabeticaly Sorted Products” plugin. This plugin lets you alphabetize products by name, SKU, or ID number. It also has an option to ignore articles like “the” or “a” when sorting products.

To use this plugin:

1.Install and activate the Alphabetically Sorted Products plugin.

2. Go to WooCommerce → Settings → Products → Alphabetically Sorter and select your sorting options.

3. Save your changes.

Editing Your Theme’s Code:

If you’re comfortable editing code, you can add a snippet of code to your theme to alphabetize your products. To do this:

1. Copy the following code snippet and paste it into the functions.php file of your child theme:

PRO TIP: If you are using WooCommerce to sell items online, it is important to make sure that your items are sorted alphabetically. This will help potential customers find the items they are looking for quickly and easily. To sort your items alphabetically, simply go to the “Products” page in your WooCommerce dashboard and click on the “Sort” button. Then, select “Alphabetically” from the drop-down menu.
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 ( 'alphabetical' == $orderby_value ) {
  $args['orderby'] = 'title';
  $args['order'] = 'asc'; }

return $args;
} add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' );
 function custom__woocommerce__product__sortable__columns( $sortable ) {
 return array( 'title' => __( 'Alphabetical', 'woocommerce' ), );
} add__filter( 'manage__woocommerce__product__sortable__columns', 'custom__woocommerce__product__sortable__columns' );

2. Save your changes and upload the file to your server.

In the WordPress admin, go to WooCommerce → Settings → Products → Product Sorting and select Alphabetical (A-Z) from the Default Product Sorting dropdown menu.
Save your changes.

That’s it! Your products should now be sorted alphabetically on your website.
If you want more control over how products are sorted on your WooCommerce store, check out our guide on How to Customize the WooCommerce Product Sort Order.

Conclusion: There are a few different ways to alphabetize products in WooCommerce. You can use a plugin like “Alphabetically Sorted Products”, or you can edit your theme’s code.

Kathy McFarland

Kathy McFarland

Devops woman in trade, tech explorer and problem navigator.