WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to, essentially, check whether a post exists and if it does (in published, draft or auto-draft states) return the post info. I'm finding get_post() doesn't seem to work with drafts, and get_posts() doesn't allow me to specify the specific post ID I'm looking for.

Is there a function to get post info for any publish_status by post ID?

share|improve this question
up vote 1 down vote accepted

There is nothing in the codex that would suggest that get_post() would not work with drafts. if you experience otherwise, try get_posts() with the include or post__in parameter.

Also see the supported type and status parameters here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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