I want to check if a post already exists. This includes to check if the post exists as draft as well. But I struggle a little bit with the wordpress API v2. http://v2.wp-api.org/reference/posts/
Under List Posts -> status they say

Limit result set to posts assigned a specific status.
Default: publish

I tried to assign the value as parameter, but I get an error response:

{"code":"rest_invalid_param","message":"Invalid parameter: status","data":{"status":400,"params":{"status":"Status is forbidden"}}}

I als asign the title of the post to check:

filter[s] = post Title

So how to get the posts with draft state? I'm currently using the Basic Auth for developing?

I also tried


but with no success.

I have the following plugins installed: WP REST API
WP REST API - filter fields
JSON Basic Authentication


I think the query parameter that you want for post status is:


Let me know if this doesn't work.

  • Yes that worked, thanks. I tried it with this at the beginning but it didn't work, so I'm confused that it works now. – Ronon Dec 1 '16 at 20:19
  • 1
    Hi! For some reason it does not seem to work for me. WP 5.3.2 and I get that status is forbidden. Using the following url: localhost/wordpress/wp-json/wp/v2/posts?status=draft The exact JSON I get is this: {"code":"rest_invalid_param","message":"Invalid parameter(s): status","data":{"status":400,"params":{"status":"Status is forbidden."}}} – Andrea Raimondi Feb 11 '20 at 3:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.