Title: Delete draft after overwritting it
Last modified: September 6, 2017

---

# Delete draft after overwritting it

 *  Resolved [bartekp](https://wordpress.org/support/users/bartekp/)
 * (@bartekp)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/delete-draft-after-overwritting-it/)
 * Hey,
    Thanks for this fantastic stuff. It works great with the latest version
   of WordPress. I have a question. Is there any chance to automatically delete 
   drafted page and overwrite the original by this one. For example: situation when
   author has end making changes and admin would like to publish it. When admin 
   click on “publish” it will be overwritten with original but in admin panel I 
   have now two similar pages. I would like to delete revision and have only one
   version – original.
 * Can I do it with simple code? Delete draft after publishing it by admin. I would
   not like to have a mess in admin panel.

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

 *  Plugin Author [jamiechong](https://wordpress.org/support/users/jamiechong/)
 * (@jamiechong)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/delete-draft-after-overwritting-it/#post-9656358)
 * [@bartekp](https://wordpress.org/support/users/bartekp/) if I added a hook that
   allowed you to run your own code after publish (I’d pass the two posts: the newly
   published post, and the one that becomes draft). Then you can decide to delete
   the draft if you’d like.
 *  Plugin Author [jamiechong](https://wordpress.org/support/users/jamiechong/)
 * (@jamiechong)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/delete-draft-after-overwritting-it/#post-9940208)
 * [@bartekp](https://wordpress.org/support/users/bartekp/) v1.3.2 now has a filter
   that prevents a revision of the original post from being created when the revision
   is published. Add this to your code:
 * `add_filter('revisionize_keep_original_on_publish', '__return_false');`

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

The topic ‘Delete draft after overwritting it’ is closed to new replies.

 * ![](https://ps.w.org/revisionize/assets/icon-256x256.png?rev=1832949)
 * [Revisionize](https://wordpress.org/plugins/revisionize/)
 * [Support Threads](https://wordpress.org/support/plugin/revisionize/)
 * [Active Topics](https://wordpress.org/support/plugin/revisionize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/revisionize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/revisionize/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [jamiechong](https://wordpress.org/support/users/jamiechong/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/delete-draft-after-overwritting-it/#post-9940208)
 * Status: resolved