I am developing a project that is using the WP REST API. After some tests, I realized that it’s not retrieving all the categories based on what I am trying to GET. In precise, there are supposed to be 21 results but only 10 come up. Is there some kind of restriction that I am not seeing? Any settings that I’ll have to change.
Here is what I am trying:
https://example.com/wp-json/wp/v2/categories?parent=97
TIA
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
As documented, the default number if results returned “per page” is 10. So you need to set per_page to however many you want to retrieve:
https://example.com/wp-json/wp/v2/categories?per_page=30
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0