WP REST API returns empty posts despite entries in wp_posts

Question

Using WP API to query posts. There are many entries in wp_posts, but the API always returns an empty array.

Request: /wp-json/wp/v2/posts/

Response: []

Request: /wp-json/wp/v2/posts/3553

Response:

{
    "code": "rest_post_invalid_id",
    "message": "Invalid post ID.",
    "data": {
        "status": 404
    }
}

Yet, querying MySQL directly:

SELECT count(*) FROM wp_posts;

returns 391

SELECT count(*) FROM `wp_posts` where id = 3553;

returns 1

Is there some inherent filtering in the API? I am stumped here.

Thanks
Mike

0
Mike Finn 7 days 0 Answers 7 views 0

Leave an answer