Revision Diet

Revision Diet is a plugin to limit the number of post revisions that are saved. I know that of the claims about how to turn off revisions and I have seen quite a few plugins that claim to remove revisions. Nothing I have done successfully prevented or limited the number of revisions being saved. Other plugins that I have tried hide extra revisions, but do not remove them from the database. One plugin I found looked like it would actually do the trick, but the author did not make any promises that it was safe to use. This plugin does not require any warnings. It does exactly what you expect – it allows you to set a number of revisions to keep for each post and deletes any revisions beyond that number. This number will not include the autosave revisions. If you set two as the limit that will allow two revisions plus the autosave revisionto be maintained. If you set zero, only the autosave will ever remain.

The options page is extremely simple – enter the number of revisions to keep and save your options. There is also a button to “Trim Excess Revisions.” This button will trim all the extra revisions from every post in your WordPress installation – this is useful (but never required) when you first install the plugin or if you chose to lower the number of revisions to save. As for regular use, each time you save a post the oldest revision(s) on that post will be deleted from the database down to the limit that is currently set (that will usually be zero or one revision deleted if you have previously run the “Trim Excess Revisions” function).

To install it simply unzip the file linked above and save it in your plugins directory under wp-content. In the plugin manager activate the plugin. Settings for the plugin may be altered under the Revision Diet page of the Options menu (version 2.3) or Settings menu (version 2.5 or later).

Comments

20 Responses to Revision Diet

  1. baron says:

    Works great, thank you

  2. Li-An says:

    I try it : 🙂

  3. Li-An says:

    Does it work with pages revision ?

    • David says:

      The “Trim Excess Revisons” button only trims post revisions, but anytime you edit a page it does trim the extra revisions for that page.

  4. Li-An says:

    OK. And do you plan to internationalize this one ? 🙂

  5. Joe says:

    I ran the trim excess revisions twice and still see all my
    revisions. What else do I need to do? Thanks, Joe

  6. Joe says:

    I set it to keep 1 revision and am using WP 3.4. The latest
    version of WP. Thanks, Joe

    • David says:

      Just to be clear, setting the revision to 1 would mean keeping the published version and any autosave version of the post plus one other revision.

      When you say 3.4 I assume you mean 3.0.4. If all of the above is accurate I’ll do some testing to see if anything is broken against the latest version of WP.

  7. Joe says:

    Dave, Yes, all is correct. But I think I might be a special
    case, my DB is almost 100mb. Much of it is revisions. Thanks for
    your speedy response. Joe

    • David says:

      I tested on my site running 3.0.4 and everything seems to be working with “Trim Excess Revisions”. Here is something to try, go into a specific post and make some meaningless update and see if it is reduced to a single revision after you update the post. Let me know if that works for a single post. If it does I might have some ideas.

  8. Joe says:

    I updated a post and all the revisions were deleted save
    the post plus 1 revision. But all the other posts remained with
    countless their revisions. Joe

    • David says:

      What might be happening is that the request to trim revisions is timing out because of the size of your database. It might work if you were to set the number of revision to a high number – perhaps 20 – and then trim excess revisions. Then set the number lower and repeat until you are where you want to be. The other option would be to do each individual post like the one you tested on.

  9. Joe says:

    Dave, It timed out on the “20…” I have 446 posts so that
    might take a while to do one by one… But I need to get started or
    else my host will raise my bill… Thanks for your support.
    Joe

    • David says:

      If you know an upper limit on how many revisions most of your posts have you can set the number of revisions near that and then you should be able to reduce it by at least 5 at a time until you get down where you want to be.

  10. Joe says:

    Dave, It worked!!! Thank you so much. I started out at 55
    and worked my way down. Had to go through 10 and under a few times.
    I took close to 35mb off my db. What is your email? I would like to
    send you a few bucks via paypal. Thanks, Joe

Leave a Reply

Your email address will not be published.

Loading Facebook Comments ...