How do I exclude a particular category in the API?
For all categories - I may use the following:
/?rest_route=/wp/v2/posts&per_page=100
What if I need across all the categories except for category-10?
I am using JavaScript at the front.
Thanks
How do I exclude a particular category in the API?
For all categories - I may use the following:
https://www.example/?rest_route=/wp/v2/posts&per_page=100
What if I need across all the categories except for category-10?
I am using JavaScript at the front.
Thanks
Share Improve this question asked May 28, 2020 at 14:26 newnew 214 bronze badges1 Answer
Reset to default 1I just figured it out, just in case it might be helpful for anyone in future:
There is an option available to exclude a particular category - categories_exclude
So, the new rest API would be:
https://www.example/?rest_route=/wp/v2/posts&per_page=100&categories_exclude=10