WordPress revisions are created automatically by WordPress every 60 seconds or by yourself when you “Preview/Update” your page/post. Although these are a great thing to enable you to revert a change you aren’t quite happy with, these fill in your database tables and put some strain on your website performance.

To limit the number of revisions your WordPress instance should save and how often, you can and should do the below:

Note: Before you start, if you aren’t very comfortable updating PHP files, you should create a backup of your website in case something goes wrong! In theory, as long as you follow the instructions below you should not encounter an issue.

You will need to open your config.php file, you can either do this by connecting via FTP or by going through to your File Management section of your Hosting.

Locate this line on your config.php file $table_prefix = ‘wp_’; and add the code below under it:

define('AUTOSAVE_INTERVAL', 300); // seconds
define('WP_POST_REVISIONS', 4);

Once done, save the file and re-upload it to your server.

This snipet of code is defining the auto save intervals to 300 seconds instead of 60 seconds and it is setting the revisions limit to 4. Feel free to change the values as you see fit, but do remember the less amount of revisions the better.

Was this article helpful?
YesNo