Why doesn't the WordPress REST API return draft posts when I use status=draft?

Was this question useful?Community ranking

Answers

1 answer

`status=draft` is a valid WordPress REST API filter, but drafts aren't public results. Make the request as an authenticated user who can actually edit those posts, ideally with `context=edit`: `/wp-json/wp/v2/posts?status=draft&context=edit`. For a remote script, use HTTPS plus an Application Password or another supported auth method. If it still comes back empty, check the account's role and whether the drafts belong to someone else. Don't make the endpoint public just to expose drafts.

Was this answer helpful?Community ranking

Your answer

Sign in to answer.

Keep exploring

Similar questions

Browse all