Home > Enterprise >  WordPress Rest API not returning all posts, videos and tags
WordPress Rest API not returning all posts, videos and tags

Time:01-29

I am trying to fetch all of the videos, tags etc etc through the Wordpress rest api but it doesn't seem to be returning all of the data that I have on Wordpress. For example I have 13 videos on the admin panel (and web app) but on the rest api I can only see 4. I don't have any filters to limit the results I get on the fetch() function.

For the tags, I have 10 for example but it only returns the 8. When I do /wp-json/wp/v2/tags/53 then I get the data for tag #53 (which is one of the tags that don't show up on /wp-json/wp/v2/tags.

CodePudding user response:

The current method of controlling the number of results returned is to add per_page as a query parameter:

website.com/wp-json/wp/v2/posts/?per_page=15

Replace 15 with the desired amount, anywhere from 1 - 100 is permitted

  • Related