I am creating custom frontend post submission form. I am using wp_insert_post for creating new post. The function is working fine but it is not creating the revision record in database.

Following is my code. I want record of every revision made in the post. Plz Help… Thanks…


if (isset($_POST['submit_post']) ) {

  $my_post = array(

      'post_title'   => wp_strip_all_tags( $_POST['post_title'] )


  wp_insert_post( $my_post );



<form method="POST">

  <div class="form-group">
    <label for="post_title">Post Title</label>
    <input type="text" class="form-control" name="post_title" placeholder="">

  <button type="submit" name="submit_post" class="btn btn-default">Submit Post</button>


1 Answer 1


wp_insert_post() currently doesn't create a revision for a newly created post.

This is a known limitation (or feature?) in WordPress core and has been reported before on WordPress Trac.

To work around this, you could try to manually call wp_save_post_revision() after inserting your post.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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