How to: Control how much post revisions are saved

Post revisions is a cool feature, but you probably know that it increase the size of your WordPress database. If you want to limit how many post revisions can be saved by WordPress, or even disabling this functionality, just read on.

To achieve this recipe, you have to edit your wp-config.php file. The wp-config.php file is WordPress configuration file, where you defined your database parameters when you installed WordPress. It is located on the root of your WordPress install.
To limit post revisions, just add the following lines:

define ('WP_POST_REVISIONS', 5); //Defines a maximum of 5 different revisions per post.
define('AUTOSAVE_INTERVAL', 3600); // Auto-saves on 1 hour interval

In this exemple, I have defined a maximum of 5 posts revisions. IF you don't want WP to save any revision, just type 0 instead of 5.

Leave a Comment

* Name, Email, Comment are Required