Home > Help Center > Applications > WordPress > WordPress Revisions

WordPress Revisions

The WordPress revisions system keeps a copy of any draft or published article or page. This option is enabled by default, and users who are unaware of its existence can easily find themselves in a situation with dozens of copies of each of their posts.

wordpress revisions

wordpress revisions

The revisions system allows you to compare the content of the published post with any available revision or compare two random revisions if the option Compare any two revisions is selected:

wordpress revisions

In this article, we'll show you how to manage WordPress revisions.

To see a list of all available revisions, click the Screen Options link in the upper right corner:

wordpress revisions

and check the box next to Revisions in the Boxes section:

wordpress revisions

Under the editor Revisions section will appear alonside all features you've activated from Screen Options > Boxes:

wordpress revisions

Autosave

When you are writing or editing your posts and pages, the changes you make are automatically saved every 2 minutes. In the lower right corner of the editor, you'll see a notification of when the entry was last saved to the database.

Autosaves are automatically enabled for all posts and pages. There is only one autosave for each post/page. Each new autosave overwrites the previous autosave in the database.

Manage Revisions

You can manage revisions by adding one line of code in wp-config.php file.

Disable revisions:

define( 'WP_POST_REVISIONS', false );

or:

define( 'WP_POST_REVISIONS', 0 );

Enable revisions (only if they were previously disabled):

define( 'WP_POST_REVISIONS', true );

or:

define( 'WP_POST_REVISIONS', -1 );

To enable saving certain number of revisions:

define( 'WP_POST_REVISIONS', 2 );

WordPress will store two revisions (+1 autosave) per post. Old revisions are automatically deleted.

Disabling revisions will deprive you of any opportunity to restore previous content. Saving all revisions will significantly increase the size of the database file. As with most things, the middle road is the safest - in our case it is to keep two revisions.

Restore Revision

Click on revision link in the revision box under the editor or click Browse link after Revisions label in the Publish box:

wordpress revisions

Clicking Previous button will activate Restore This Revision button:

wordpress revisions

Click to restore the old revision:

wordpress revisions

Delete Revisions

If you've posted with WordPress for a while, a significant number of revisions may have been collected in the database. The best option is to use a plugin to delete all available revisions and add the code to wp-config.php.

One plugin that does a great job is WP-Optimize:

wordpress revisions

Install and Activate the plugin. Click the WP-Optimize link in the menu:

wordpress revisions

These are the default settings, you can leave only Clean all post revisions checked and run only this option by clicking on Run optimization button:

wordpress revisions

wordpress revisions

All saved revisions are deleted, but due to the available code in wp-config.php:

Define ('WP_POST_REVISIONS', 2);

WordPress will continue to record two revisions for each published post or page.

Be careful when using the WP-Optimize plug-in for red-marked operations - always create a database backup to eliminate the possibility of database chrash and site downtime.

wordpress revisions

#wordpress #settings

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support