Advanced Taxonomy Terms Order

Advanced Taxonomy Terms Order is the Premium version of Category Order and Taxonomy Terms Order, both by NSP Code.
Compared to the free Category Order and Taxonomy Terms Order plugin, this paid plugin (not too expensive, with a one-time payment only) has much better compatibility with facet ordering and works in all scenarios and facets. We recommend choosing this one over the free version. Or, for a free option, choose Intuitive Custom Post Order.
If you want to use this plugin to order the taxonomy terms for one or more taxonomies, make sure to go through the setup instructions below to preserve that order for facets that use these taxonomies as their data source, and have “Term order” set in their “Sort by” setting.
Ordering interfaces
Aside from the plugin’s own drag-and-drop ordering interface, for each taxonomy you can also enable sortable drag-and-drop functionality in the WordPress taxonomy term list screens, by enabling the taxonomy in the “Default Interface Sort” setting. The “Admin Sort” setting must also be enabled for this. The order in both interfaces automatically syncs when making changes.
Ordering WooCommerce product categories
For WooCommerce product categories, you can choose between two ordering interfaces: the plugin’s drag-and-drop interface, or the default WooCommerce drag-and-drop interface.
If you enable “Default Interface Sort” for product categories, and “Admin Sort”, it will take over the default WooCommerce drag-drop interface. If you want to keep that for some reason, just don’t enable the “Default Interface Sort” setting for product categories, and disable “Admin Sort”.
Setup
- First, create (or edit) a facet and set its data source to a taxonomy. You’re going to order the terms of this taxonomy with Advanced Taxonomy Terms Order.
-

The “Sort by > Term order” facet setting. Set the facet’s “Sort by” option to “Term order”. Only the following facet types have this setting: Checkboxes, Dropdown, Radio, fSelect, Hierarchy, Hierarchy Select, and Color.
-
Next, in Settings > Taxonomy Terms Order, enable the “Auto Sort” setting:

Enable “Auto Sort”. If, for some reason, you don’t want “Auto Sort” enabled, add the following snippet to your (child) theme’s functions.php instead, to fix the facet order when using “Term order”:
How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info
// Use only with "Auto Sort" disabled: // If not using WooCommerce, // or if so, to also order product categories with Advanced Taxonomy Terms Order add_filter( 'get_terms_args', function( $args, $taxonomies ) { if ( isset( $args['term_order'] ) ) { $args['orderby'] = 'term_order'; } return $args; }, 10, 2 ); add_filter( 'get_terms_orderby', function( $orderby, $query_vars, $taxonomies ) { return 'term_order' === $query_vars['orderby'] ? 't.term_order' : $orderby; }, 10, 3 );If you are using WooCommerce, and you have also disabled the “Default Interface Sort” setting for product categories, in order to use the default WooCommerce drag-and-drop interface, as described above, use the following snippet instead. It fixes taxonomy ordering for all taxonomies like the above snippet, but preserves WooCommerce drag-and-drop ordering for product categories (which happens by a term meta field named “order”). Make sure to also disable “Admin Sort”.
How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info
// Use only with "Auto Sort" and "Admin Sort" disabled and “Default Interface Sort” not enabled for product categories: // to order product categories with WooCommerce drag-and-drop instead of Advanced Taxonomy Terms Order add_filter( 'get_terms_args', function( $args, $taxonomies ) { if ( isset( $args['term_order'] ) && 'order' !== $args['meta_key'] ) { $args['orderby'] = 'term_order'; } return $args; }, 10, 2 ); add_filter( 'get_terms_orderby', function( $orderby, $query_vars, $taxonomies ) { return 'term_order' === $query_vars['orderby'] ? 't.term_order' : $orderby; }, 10, 3 ); - Next, in Your Post Type > Taxonomy Order, order the terms with the plugin’s ordering interface. Or, if you enabled “Default Interface Sort” for your taxonomy, go to its WordPress admin screen, and use drag-and-drop to customize the order there.
- Last but not least: do a full re-index.