Changing WordPress’ Autosave Frequency and Post Revisions

WordPress has a very nifty autosave feature which can be a lifesaver to anyone who uses WordPress. The downside to WordPress’ autosave, is that it creates a bunch of draft posts increasing your mySQL database size, especially if you write the post within WordPress’ post editor.

If desired, it is possible to change WordPress’ autosave frequency, or even disable the WordPress autosave feature entirely. Furthermore, if you wish to disable WordPress’ post revisions, or limit the total number of post revisions, both are simple to do in WordPress.

The following code snippets will need to be placed in your WordPress install’s wp-config.php. It’s a simple copy and paste, but be careful. If you mess up your WordPress install’s wp-config.php, the WordPress site will break. If you break your WordPress site while editing the wp-config.php file, undo your changes and re-save your WordPress install’s wp-config.php file and everything should be fixed.

How to Change WordPress’ Autosave Frequency

Simply paste the following snippet in your WordPress install’s wp-config.php to change WordPress’ autosave frequency to save every 5 minutes. The integer is the total number of seconds between each autosave.

define('AUTOSAVE_INTERVAL', 300 );  // integer is in seconds

How to Disable WordPress’ Post Revisions

Simply paste the following snippet in your WordPress install’s wp-config.php to disable WordPress’ post revisions feature.

define('WP_POST_REVISIONS', false ); // disable post revisions

How to Limit WordPress’ Post Revisions

Simply paste the following snippet in your WordPress install’s wp-config.php to adjust the limit of WordPress’ revisions that are kept from WordPress’ autosave feature

define('WP_POST_REVISIONS', 3); // alter number of post revisions kept.

Conclusion

It’s that simple to change WordPress’ autosave frequency or even completely disable WordPress’ post revisions. Doing so will decrease the size of WordPress’ database, but will limit the ability to recover from mistakes. So this WordPress modification could come in handy, or cause problems. Be careful.

Follow wpLifeGuard

« Back to Blog