Retrieve REST Posts for Specific Pages

After a lot of research I have finally found a way to retrieve specific pages from a WordPress REST site using it’s JSON feed. I should note that this is not complicated at all, just frustratingly badly documented!

http://www.mysite.com/wp-json/wp/v2/pages?include=8,528

In this case the link would go to mysite.com and retrieve the pages with ID’s of 8 and 528 only. Very useful for doing something like related pages.

As I said it’s not rocket science, but it’s taken me a really long time to find this!

Leave a Reply

Your email address will not be published. Required fields are marked *