Change Category Order in WordPress and WooCommerce

If you want to change the default order of categories in your WordPress and WooCommerce site, it may not be immediately apparent how this can be done.

But it’s important – the order of your categories has a big effect on how readers approach and interact with your website. By default, WordPress arranges categories in alphabetical order, which may not be the optimal category order for you.

WordPress Category and Taxonomy Terms – A Great Method to Organize Content

To begin with, a taxonomy provides a great solution for web owners to group related posts together and for readers to find related content. Categories and tags are the default taxonomies used for facilitating structuring your content in WordPress. What’s more, taxonomy terms refer to the items in a taxonomy.

For example, there are sports, films, and music included in your site’s category. While the category itself is a taxonomy, sports, film, and music are known as taxonomy terms.

While WordPress handles posts in reverse chronological order, these taxonomy terms are displayed automatically in alphabetical order in the widget and below each post.

Sometimes, you may want to put the important category on the top to let the readers get more exposure to the term you intend to deliver. Depending on your needs, you can choose the suitable method mentioned below to sort out how your categories display to users.

How to Change Category Order in WordPress

Below, I’ll cover two approaches to reordering your WordPress categories: a plugin-based solution that’s perfect for beginners and those who prefer a visual interface, and a code-based method for developers or those comfortable with editing theme files.

Each approach has its advantages – the plugin offers simplicity while the code snippet provides more precise control without adding extra plugins to your site.

Method 1: Use Category Order and Taxonomy Terms Order  plugin

The Category Order and Taxonomy Terms Order plugin allows you to change the category order pretty quickly and easily.

After installing the plugin, head to the WordPress Dashboard→ Posts → Taxonomy Order.

categoryorder_plugin

Here, you can use the drag and drop the listed categories and move them into your preferred order. This plugin is the quick, simple solution for those that don’t want to manually edit their .php file.

Method 2: Use a quick code snippet

You can also do this by adding code to the category’s core files. This option requires more technical knowledge, and could end up breaking your website if not done correctly.

If you’re confident, to use this method go to your theme’s category.php file and add the following code:

<?php
$categories = get_terms('books_category');
for ($i = 0; $i < sizeof($categories); $i++) {
if ($categories[$i]->name == 'New Publications') :
$latest = array($categories[$i]);
unset($categories[$i]);
endif;
}
if (isset($latest)) {
array_splice($categories, 0, 0, $latest);
}
?>

While the methods above work great for standard WordPress categories, WooCommerce introduces its own category system designed specifically for product organization.

If you’re running an online store, you’ll likely need to organize both your blog content (using WordPress categories) and your products (using WooCommerce categories). Let’s look at how to customize your WooCommerce category order to create a more intuitive shopping experience.

Changing the Order of WooCommerce Product Categories

Optimizing your WooCommerce product category order can help boost sales for your online store. You’ll need to adjust two different areas since categories appear in both the sidebar and the main catalog.

Reordering Categories in the Sidebar

  1. Go to Appearance → Widgets in your WordPress dashboard
  2. Find your sidebar widget area and locate the WooCommerce Product Categories widget
  3. Open the widget settings and select your preferred sorting option (name, order, or count)
  4. If using “order” as your sorting method, you can set custom ordering numbers in each category’s settings
  5. Save your changes

It’s important to note that WooCommerce displays your product categories in two distinct places, each serving a different purpose.

The sidebar categories act as navigation filters, helping customers narrow down their search, while the main catalog categories showcase your product groups on category pages. For the best user experience, you’ll want to optimize both locations, which require slightly different approaches.

Reordering Categories in the Main Catalog

  1. Go to Products → Categories in your WordPress dashboard
  2. Click on the Product Categories tab
  3. Scroll down to find your categories list
  4. Drag and drop your categories into your preferred order
  5. Click Save Changes when finished

How to Customize the Default Product Sort Order on Category Pages

Now that you’ve organized your categories in a logical order, the next step is to control how individual products are sorted within those categories.

While category order helps customers find the right product type, product sorting helps them find specific items based on criteria like price, popularity, or recency. WooCommerce offers several options for controlling this aspect of your store organization.

Setting the Default Sort Order

Go to WooCommerce → Settings → Products in your WordPress dashboard.

categoryorder_productsort1

Open the Display tab.

Under “Default Product Sorting,” choose from these options:

categoryorder_productsort2

  • Default sorting (custom + name)
  • Popularity (sales)
  • Average rating
  • Most recent
  • Price (ascending)
  • Price (descending)

After selecting your Default product sorting filter, you can save your changes.

Custom Product Ordering

  1. Go to Products → All Products in your WordPress dashboard
  2. Click on Sort Products at the top of the page
  3. Drag and drop your products into your preferred order for the Shop page
  4. Save your changes

Note: This custom sorting method works by changing the “menu order” value under Product Data → Advanced for each product. If you later want to return to alphabetical sorting, you’ll need to reset the menu order value to 0 for each product, which can be time-consuming for large inventories.

Conclusion

In WordPress, you can either add a custom code snippet to the theme’s category.php file or use the Category Order and Taxonomy Terms Order plugin to drag and drop selected categories into place.

In WooCommerce, customizing both product categories and sorting orders contributes to improving the product browsing experience of customers. Depending on the sorting order you wish to change, your level of technical expertise, the kind of your site, you can go with either of these solutions.