Title: programatically posting drafts?
Last modified: August 18, 2016

---

# programatically posting drafts?

 *  [darrellberry](https://wordpress.org/support/users/darrellberry/)
 * (@darrellberry)
 * [21 years ago](https://wordpress.org/support/topic/programatically-posting-drafts/)
 * i’m trying to hack the ‘Chech/Hewitt’ enhanced post-by-mail plugin so that it
   posts with status ‘draft’ rather than ‘publish’. this seems harder than expected.
   if i hack the record its sending to the database to include
 * post_staus => ‘draft’
 * then the post shows up in the database , but not in the web interface.
 * from reading the API docs, it seems that the publish_post hook (as in
 * do_action(‘publish_post’, $post_ID);
 * ALWAYS sets publish status top ‘publish’. What’s the ‘recommended’ way to programattically
   post an entry and have it show up as a draft rather than a published post?
 * thx

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [cincen](https://wordpress.org/support/users/cincen/)
 * (@cincen)
 * [21 years ago](https://wordpress.org/support/topic/programatically-posting-drafts/#post-182364)
 * set also post_author to one existing author ID:
 * ‘post_status’ => draft,
    ‘post_author’ => 2,
 *  Thread Starter [darrellberry](https://wordpress.org/support/users/darrellberry/)
 * (@darrellberry)
 * [21 years ago](https://wordpress.org/support/topic/programatically-posting-drafts/#post-182419)
 * of course! it was posting those as drafts for the user who emailed them in, not
   for the site admin (which i was logged in as) — obvious!
 * thanks

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘programatically posting drafts?’ is closed to new replies.

 * 2 replies
 * 2 participants
 * Last reply from: [darrellberry](https://wordpress.org/support/users/darrellberry/)
 * Last activity: [21 years ago](https://wordpress.org/support/topic/programatically-posting-drafts/#post-182419)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
