Limit the number of post revisions in WordPress

For each saved edit made to a post or a page, WordPress saves a revision in the database. This can really increase the size of your database when your working with a lot of posts or pages. WordPress has a built-in revisions option which you can set in the wp-config.php file. You can also disable revisions altogether.

To disable revisions completely: 

define( 'WP_POST_REVISIONS', false );

 To limit the amount of revisions:

define( 'WP_POST_REVISIONS', 3 );

You could also just download the Revisions plugin 

That way you can set the revisions number from the admin section.

 Revisions plugin WordPress

 

WordPress also saves an auto-save revision when editing a post or page. You can set the interval of this auto-save function. By default it saves a revision every 60 seconds. 

Set the auto-save interval:

define( 'AUTOSAVE_INTERVAL', 150 );

 

3 thoughts on “Limit the number of post revisions in WordPress

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s