Limiting the number of post/page revisions that are saved in WordPress

Whenever you modify a post or page on your WordPress site, a copy of is saved to make it possible to revert any changes that have been made.  Although this is a great feature when you quickly need to revert site content, the number of revisions can quickly add up and begin to take up a large amount of space in your database.  It is possible to set a maximum number of revisions that will be saved for each post/page by adding the following snippet to wp-config.php


/* keep a maximum of 5 revisions for each post/page */
define('WP_POST_REVISIONS', 5);
/* disable revisions for post/pages */
define('WP_POST_REVISIONS', 9);