Deleting and/or Limiting Post Revisions in 2.6? (6 posts)

  1. Anonymous
    Posted 7 years ago #

    Is there a way to delete or limit the amount of post revisions for each post?

  2. mystifier
    Posted 7 years ago #

    You will have to delete revisions in the database; there is, strangely, no current provision from WordPress.
    i.e. Delete from wp_posts where post_status='revision' and ....

    You can restrict the number of revisions by adding
    define ('WP_POST_REVISIONS', X);
    to wp-config (where X is the number of desired revisions, default=until your database falls over with the burden).

  3. grimer
    Posted 7 years ago #

    Greaty, I was just looking for this too :)
    So presumably you could add X = 1 to just save one revision, i.e. the current post ?

  4. Jo5329
    Posted 7 years ago #

    That's great for those that have a clue how to do this and no problem messing with back end config ... but I'm not one of those. I want these gone and an easier way to do it ... come on WordPress ... this is a space waster for those of us with small blogs. How above a way to delete them once the post has published?

  5. WPChina
    Posted 7 years ago #

    @Jo5329: adding define ('WP_POST_REVISIONS', X); seems pretty darn simple to me since you need to add other things to that file anyway when setting up WP ;)

    Though I agree it would be much better to have it in the control panel -- maybe in the Settings/Writing admin area.

  6. ninjaboy
    Posted 6 years ago #

    I think this functionality will come in due time. In the meantime, I've been using the WP-CMS Post Control plugin over at http://wordpress.org/extend/plugins/wp-cms-post-control/ to disable post revisions. It also allows you to control over aspect of the write post/page panel, and turn off autosave.

Topic Closed

This topic has been closed to new replies.

About this Topic