Sorting & Ordering

Available Sort Options

orderby Value Description
name Alphabetical by category name. Most common choice.
id Numerical order by the category’s term ID (reflects creation order).
slug Alphabetical by URL slug.
order Custom drag-and-drop order set in WooCommerce.
count By product count, highest first (when order=desc).

Setting Custom Order in WooCommerce

WooCommerce lets you set a drag-and-drop order for product categories. To use it:

  1. Go to Products → Categories.
  2. Click Configure order (the link appears near the category list heading).
  3. Drag categories into your desired sequence.
  4. Click Save order.
  5. In WCA settings (or shortcode), set orderby="order".

Note: Custom order is stored as term_order in the wp_term_taxonomy table. If your site has many categories and drag-and-drop is slow, use the Category Order and Taxonomy Terms Order plugin for a better UI.

Excluding Categories

To exclude specific categories from the accordion, find their IDs and add them to the Exclude Categories setting (or the exclude shortcode attribute).

Finding a Category ID

  1. Go to Products → Categories.
  2. Hover over the category name — the term ID appears in the URL at the bottom of your browser: term_id=42.
  3. Alternatively, click the category to edit it and note the tag_ID value in the address bar.

Excluding via Shortcode

[WC-Category-Accordion exclude="12,45,67"]

Excluded categories and all their children are hidden from the accordion. They are not removed from your WooCommerce shop — only from the accordion display.

Sort Direction

Use order="asc" or order="desc" to control sort direction. For alphabetical, ASC (A→Z) is most common. For count-based sorting, DESC (most products first) usually makes the most sense.

Shortcode
[WC-Category-Accordion orderby="name" order="asc"]

Code Snippets

Sort alphabetically A–Z SHORTCODE
[WC-Category-Accordion orderby="name" order="asc"]
Sort by custom WooCommerce drag-and-drop order SHORTCODE
[WC-Category-Accordion orderby="order"]
Sort by product count, most products first SHORTCODE
[WC-Category-Accordion orderby="count" order="desc"]
Exclude category IDs 12, 45, and 67 SHORTCODE
[WC-Category-Accordion exclude="12,45,67"]

Frequently Asked Questions