Title: wp_insert_post() doesnt create revision
Last modified: August 21, 2016

---

# wp_insert_post() doesnt create revision

 *  [essha](https://wordpress.org/support/users/essha/)
 * (@essha)
 * [12 years ago](https://wordpress.org/support/topic/wp_insert_post-doesnt-create-revision/)
 * Creating a new post via backend inserts additional a revision at table wp_posts
   with same date.
    But creating via wp_insert_post() does _not_.
 * What is the correct way to add a post programmatically?

Viewing 1 replies (of 1 total)

 *  [Rajan Vijayan](https://wordpress.org/support/users/rajanit2000/)
 * (@rajanit2000)
 * [12 years ago](https://wordpress.org/support/topic/wp_insert_post-doesnt-create-revision/#post-4970659)
 * Hi essha.,
 * wp_insert_post() does not create any revision because its new post it does not
   need to create revision. Revision means backup of existing one.
 * You can use `<?php wp_update_post( $post ); ?>`

Viewing 1 replies (of 1 total)

The topic ‘wp_insert_post() doesnt create revision’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Rajan Vijayan](https://wordpress.org/support/users/rajanit2000/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/wp_insert_post-doesnt-create-revision/#post-4970659)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
