This post can be a solution, but I guess there could be something more linear or native:


The official REST API guide is not really clear to me, and doesn't have much examples.

I've got a custom 'dealer_areas' taxonomy, hierarchical (continents > countries > regions).

I need to build a small js app based on that and, even if I could use the 'regular' admin-ajax way, this time I'd like to use the REST API instead.

I use https://httpie.org/ client (just to have some syntax sugar and pretty printing), but it could be any. If I ask for this, I get some terms, but not all:

http GET dev.example.com/my-site/wp-json/wp/v2/dealer_areas

I get terms from every nesting level, but not all.. And they're not returned based on post counts, so it really seems there's no logic in this.

Anyway, I'd like a direct way to get all the terms from all nesting levels (even empty ones).

Is there any or am I forced to create a custom route?

  • we are speaking of rest api here. – Luca Reghellin May 22 at 8:22
  • of course, but I was asking if there's some more linear/native way other than registering a custom route. I already can do it with custom routes, that's not an issue. – Luca Reghellin May 22 at 8:33
  • OK, I understand – nmr May 22 at 8:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.