Disable Post Revisions

Disable Post Revisions

Nov 27

If you have run a WordPress blog for any length of time, you should know how large the SQL database can get.

This is largely due to the “Post Revisions”, which get auto-saved.
If you edit a post a few times, a huge list of revisions gets saved to the database. You can see these at the bottom of the post editing page.

This post has easy methods to disable and delete the post revisions, which are automatically cached by WordPress.

If you don’t use or need the post revisions which Worpdress has already saved for you, then you can delete them all by using the SQL query below:

DELETE FROM wp_posts WHERE post_type='revision';

You can also disable it from executing to start with by opening wp-config.php in your blog’s home directory.
Search for:

define('DB_COLLATE', '');

And add this under it:

define('WP_POST_REVISIONS', 0);
define('AUTOSAVE_INTERVAL', 600);

There is also a great WordPress Plug-in called WP-CMS Post Control, which gives you more control over how posts are edited.
This great WordPress plugin will allow you to:

  • Force standard browser upload instead of Flash upload
  • Turn off the revisions feature
  • Turn off the auto save feature
  • Create a collapsable message panel that appears below the write panel
  • Control which options are shown on the post page

I prefer to use the manual method, as too many plug-ins for WordPress can cause problems.

I don’t know anyone that has found the post revisions that WordPress saves, usefull.
Maybe in a future edition (v2.7 hopefully), they will include an option to disable from the admin control panel. But untill then thousands of blog owners will have to do it manually or use a plugin!



- - - (Related Tags)

5 comments

  1. SEO

    Great post. Thanks for sharing!

  2. TechForum

    Should this speed up wordpress at the same time? I’ve got WP running on one site and it takes almost 2 seconds to generate the page (debug says that’s down to PHP, not MySQL though?)

  3. Abe

    @TechForum:
    It won’t hurt. The main reason WordPress is slow, is due to the way it caches files.

    A WordPress plugin like WP Super Cache should help bring the PHP page generation time down a lot ;)

  4. angelez

    is this same as like

    define('WP_POST_REVISIONS', false);

    whats the difference?

  5. define('WP_POST_REVISIONS', 0);
    define('AUTOSAVE_INTERVAL', 600);

    And

    define('WP_POST_REVISIONS', false);

    Are the same, but the top version will also disable the Autosave feature too.

    I found the Autosave to be more annoying than useful. I tend to edit posts many times to get the required page layout, so I did not to use it very much.

Trackbacks/Pingbacks

  1. scriptygoddess » Turn off Wordpress Post Revisions - [...] I've probably seen it at least a dozen times. Just now when I was searching for it I found ...

Leave a Reply

You must be logged in to post a comment.