0

Wordpress rest api for categories is displaying 10 categories only. how can i get all list of categories in the api. please help me out of this.

Thanks

0
0

This is the REST API Pagination: by default you'll get a page of 10 results and two headers in the results, X-WP-Total and X-WP-TotalPages, to tell you how many pages of results there are.

You can request more results in one go by adding ?per_page=100 to the request, i.e.

https://example.com/wp-json/wp/v2/categories?per_page=100

100 is the maximum you can request at once. You should then check the X-WP-TotalPages header in the response and if it's more than 1 you need to repeat for further pages of results, i.e.

https://example.com/wp-json/wp/v2/categories?per_page=100&page=2
https://example.com/wp-json/wp/v2/categories?per_page=100&page=3

etc. as appropriate.

1
  • Thank you, Its working
    – saicharan
    Aug 20 '19 at 4:37

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.