If you’re like most people, you’ll want to save a couple of post revisions for every post you add to your site – just to be on the safe side. For this, the best option is to set a limit on the number of post revisions that are saved to your database.
You can do that by adding the following line to your wp-config.php file:
define( ‘WP_POST_REVISIONS’, 3 );
This line saves the three most recent post revisions instead of all of them, meaning the older ones are automatically deleted once newer versions are saved. You can replace the number three with another integer depending on your preference.
Instead of limiting the post revisions to a pre-defined number, you can also increase the auto-save interval to save fewer revisions. To do this, open up your site’s wp-config.php file and add the following line at the top:
define( ‘AUTOSAVE_INTERVAL’, 600 );
By default, WordPress auto-saves your post revisions every minute (60 seconds). However, by adding this line it will save them every 10 minutes (600 seconds). This automatically reduces the number of post revisions that are stored in the database.