WordPress Rest API Get specific posts by IDs by using `include` parameter


With the Rest API we get all the posts. But, Sometimes we want to get only specific posts by post ids. WordPress have rest API parameter include which return only requested posts by post ids.

Syntax Syntax


Top ↑

Example Example


It return only 2 posts whose ids are 11 & 12.

Note: By default it return 10 posts. If you have more than 10 posts then add parameter `per_page` which return all the posts.

Example 2:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: