Rest API only returns 10 posts
-
Hello,
I am trying to pull all posts for a CPT called “Videos” using the REST API. Here is the URL I’m using.
What I can’t change is the number of posts returned. There are 27 video posts. You can see additional posts if you look at page 2 of the results.
https://jeffco.sdcloudlab.com/wp-json/wp/v2/videos?page=2
On the Settings > General tab, I have changed the setting for both “Blog pages show at most” and “Syndication feeds show the most recent” to 100. No change. I tried setting it to -1 and 0 but it insists on a number greater than 0.
I have also tried adding the filters:
https://jeffco.sdcloudlab.com/wp-json/wp/v2/videos?filter[posts_per_page]=100
(switching this to a link messes it up so I’ll just leave it raw)And with the newer syntax (I think):
https://jeffco.sdcloudlab.com/wp-json/wp/v2/videos?posts_per_page=100
I’m happy to post my code, but the code seems to be handling the input properly, it’s just that the input is limited. My next step is to try to step through the pages, but I feel like I’m missing something simple.
Thanks for reading. Any help is appreciated even if it’s just a link pointing me in the right direction. I’m pretty new to this stuff so maybe I’m not searching the right terms.
Thanks,
SwaniThe page I need help with: [log in to see the link]
- The topic ‘Rest API only returns 10 posts’ is closed to new replies.