Order terms by term_order

As this is one of the top results on Google and none of the above quite worked for me, this did seem to return terms in an order matching their display in the admin…

 get_terms([
  'taxonomy'   => 'whatever_you_want',
  'meta_key'   => 'order',
  'orderby'    => 'meta_value_num'
]);

In case it helps anyone, WP stores a value in the termmeta table under the key order which represents its display position in the admin menus. Obviously it would need to be adapted if you wanted to query on other meta at the same time.

Leave a Comment