Managing Autosave/Post Revisions

WPMU now has a built in autosave feature that automatically saves when the author is editing a post. The main disadvantage to the feature is the frequency at which it kicks in. While some may type up their posts elsewhere, I actually type my posts into the WPMU editor. By default, the autosave kicks in every minute and on my computer/connection averages about 3 seconds to complete. I have also had issues with a manual save giving a WSOD if an autosave was already in progress. At the 3 second average that means there is a 5% chance that a manual save will intersect an autosave.

You can alter the autosave behaviour by adding a couple defines to your wp-config.php:

define('AUTOSAVE_INTERVAL', 300);

The autosave interval is in seconds. An interval of 300 is 5 minutes. Unless there was a compelling reason to do so, I would not have the autosave interval set to less than 5 minutes. 10 minutes is still a fairly reasonable interval.

A second feature that has been added is post revisions. A user can access these via the bottom of the write post area. If post revisions go unmanaged, they are likely to significantly swell the size of your database.

define('WP_POST_REVISIONS', 3);

With this define, I am telling WPMU to only keep 3 revisions. When the 4th revision is saved, the first is purged off. Alternatively, post revisions can be disabled with the following define:

define('WP_POST_REVISIONS', false);

About Ron

Homeschooling dad of 4 (ages 27 - 14), grampy to 3, WordPress core contributor, former farmboy & software developer by profession.

Comments

  1. Thanks for this post! I had thought about looking into this cause I don’t like either the frequency or quantity of saved revisions on my install. You saved me some time by pointing me exactly where I need to go and make those changes.

    You are awesome!

  2. Great advice…

    I had the autosave interval set as that was a resource hog, but wasn’t aware I could limit the post revisions…