Disable/Turn off post revisions and increase post autosave interval in wordpress 2.6

WordPress 2.6 is out and every wordpress user is busy upgrading to the latest version. I already did a review of wordpress 2.6 features here.One of the features, that I felt, should have been an optional one for the wordpress user is “Post Revisions“.

WordPress 2.6 has also introduced this annoying auto save feature, that automatically saves posts at regular time intervals.This would also lead to additional post revision entries in your wordpress database (wp_posts table).

In notime, you would find your wordpress database bloated.In the long run, this would not only affect performance but would also lead to increased download times of your wordpress database backups.Ideally wordpress 2.6 should have provided these as optional features, making it easy to turn them off, through settings in wordpress administration.

Since the option to turn them off was not there, I was just looking for a way to disable these features. I stumbled upon this cool solution.

How to turn off Post Revisions or Post auto save in wordpress 2.6?

To turn off Post Revisions in wordpress 2.6, add the following to your wp-config.php file:

define(‘WP_POST_REVISIONS’, false);

How to change the timing (in seconds) WordPress auto saves a post

Add this following code to wp-config.php to define post autosave as 60 seconds.This configuration will tell wordpress 2.6 to auto save a post only once in 60 seconds.If you want to specify an even higher time interval, just increase this configuration (in seconds) accordingly.

define(‘AUTOSAVE_INTERVAL’, 60);

How to delete existing post revisions and post autosaves?

If you have already made several posts after upgrading to wordpress 2.6, then delete the post revisions by executing the following query.But before executing any update or delete queries, it is a good idea to backup your database.

DELETE FROM wp_posts WHERE post_type = “revision”;

Now go ahead and disable/turn off post revisions and increase post autosave interval in wordpress 2.6.

6 comments on “Disable/Turn off post revisions and increase post autosave interval in wordpress 2.6
  1. […] Techblissonline […]

  2. […] Weg, Einträge in der wp_config von Hand tätigen. techblissonline.com schreibt, dass man in der wp_config den Eintrag define(’WP_POST_REVISIONS’, […]

  3. Have you heard anywhere of problems people have had doing this? I’m a bit wary of setting things in wp-config since I have a knack for breaking WP! But I’d very much like to get rid of the auto-save if I can because it messes up the Series Options plugin.

    Great blog, BTW. I’ve got heaps of useful info from here! Glad I found you 🙂

    Ricky

    Ricky Buchanan’s last blog post..iPhone Assistive Technology Round-Up

  4. Ricky, WordPress should have given an easier option to enable/disable it.

    But unfortunately this is the only fix available now and it is really worth doing it as otherwise you will have a lot of rows for every post.It is really ridiculous that they have introduced this feature without providing an easier option to get out of it..Rather this feature should have only been an option available to the user.

    But you can just add them anywhere in your wp-config.I have done it already and wordpress 2.6 works like a charm now.

  5. I would be curious to see if they will remove or allow to turn off this feature in the admin dashboard in the coming release knowing the number of people complaining about it…

    Olivier’s last blog post..ThyssenKrupp

  6. The feature is also starting to annoy me. Indeed, it’s just making a waste out of the database. Thank you very much for this post!

  7. […] einen interessanten Hinweis gefunden wie man die Revisionen bzw. die Versionierung im WordPress (seit Version 2.6 enthalten) […]

  8. You can continue to apply this for WordPress 2.7 as well…

  9. >>How to delete existing post revisions and post autosaves?
    >> DELETE FROM wp_posts WHERE post_type = «revision»;

    DELETE `p`, `pm`, `c`, `tr`
    FROM `wp_posts` AS `p`
    LEFT JOIN `wp_postmeta` AS `pm`
    ON `p`.`ID` = `pm`.`post_id`
    LEFT JOIN `wp_comments` AS `c`
    ON `p`.`ID` = `c`.`comment_post_ID`
    LEFT JOIN `wp_term_relationships` AS `tr`
    ON `p`.`ID` = `tr`.`object_id`
    WHERE
    `p`.`post_type` = ‘revision’;

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Recommended Videos

Setting Auto-Save interval for faster Wordpress Blogs
Setting Auto-Save interval for faster Wordpress Blogs