Control how much wordpress post revisions are saved

October 31, 2008 · Print This Article

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.

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.

Your choice for site templates and wordpress themes


Got something to say?

You must be logged in to post a comment.