Is it possible to sort product categories?
I have a category with a lot of subcategories. On the category page all the subcategories is listed. Right now I can only change the order by drag and drop in the admin panel. But that is very time consuming with a lot of categories. Any way to change the order without using drag and drop?
Woocommerce stores ‘order’ metakeys in the table
wp_woocommerce_termmeta
. The mechanism it uses is the same asmenu_order
for posts.Something like this should work:
The same procedure can be used to sort other Woocommerce taxonomies such as
product_tag
and Product Attributes. For a Product Attribute named Size, the taxonomy would bepa_size
, and you should replace ‘order’ byorder_pa_size
You can sort product categories by drag-and-drop. Notice that your mouse cursor turns into a hand when over a category row? Grab it and drag to its new position in the list. Job is done.