WordPress post revisions

WordPress post revisions are a helpful core feature that let you quickly view previous versions of your posts or pages, as well as see what changes have been made and restore one of those previous versions, if desired.

In this article, we will cover everything that you need to know about WordPress post revisions. In addition to learning what revisions are and how they function, you’ll also learn how to:

  • Access all the revisions for your posts
  • Compare two revisions against one another
  • Restore a revision to the WordPress editor
  • Change how many revisions WordPress stores
  • Completely disable revisions

How WordPress post revisions work

Here’s how revisions function by default in WordPress:

Every time that you save a draft or publish/update a post, WordPress saves a copy of how the post looked at that exact moment as a revision.

You can always go back in and access that specific revision to view it or restore it to the current version of your post. It’s there forever.

Additionally, each revision also tracks which user made the changes and when, which is helpful for keeping track of who’s doing what with your content.

How autosaves connect with revisions

Revisions are connected to another feature called autosaves. By default, WordPress will save a copy of your content every 60 seconds while you’re editing it (this saved copy is overwritten every 60 seconds – there can only ever be one autosave for each user).

This is to help you avoid losing your content in the event of a browser crash or lost Internet connection.

You can also access autosaves using the revision interface. Autosaves are labeled Autosave and are marked with red text, though, which makes them stand out from regular revisions.

How to view WordPress post revisions

To access revisions for your post, look for the Revisions option under Publish in the WordPress editor. Then, click the Browse link.

Note, this option will only show up after you have at least two different versions of the post. If you’ve never edited the post before, you won’t see it:

where to access wordpress post revisions

In the Revisions interface, you can use the slider to move between different revisions. Each time you move the slider, you’ll see:

  • A version of the previous revision on the left
  • A version of the selected revision on the right

As you drag the slider, you’ll also see:

  • Who made each revision (helpful for multi-author blogs or working with editors)
  • When the revision was made

There’s also helpful color-coding to indicate the specific changes that were made between each revision. For example:

  • A green background indicates added content
  • A red background indicates deleted content

compare changes between revisions

How to compare different revisions against one another

By dragging the slider, you can compare two revisions but only in sequential order.

If you want to compare two revisions that didn’t happen sequentially, you can check the box for Compare any two revisions and then use the additional slider option to select the exact revisions to compare:

compare non-sequential revisions

How to restore a post revision

When you restore a post revision, you overwrite the current WordPress editor to restore the content from the revision.

To do this, all you need to do is select the revision that you want to restore with the slider and then click the Restore This Revision button:

restore a revision

If you select an autosave, you’ll see Restore This Autosave instead:

restore an autosave

Once you click the button, you’ll be taken back to the WordPress editor and you’ll see the restored version. You’ll need to save a draft or update the post to make the revision permanent, though.

Of course, if you want to restore the version that you overwrote, you can always jump back into the Revisions area and restore the previous version from before you restored the current version. It’s revision-ception!

How to modify how WordPress handles post revisions

Some webmasters want to modify the WordPress post revisions system for performance reasons. By default, WordPress stores a separate revision every single time you make a change to a piece of content.

If you’re constantly editing and adjusting content, this can quickly add up.

See, each time that WordPress saves a revision, it stores a complete copy of that revision in your site’s database. This is, in part, why you’re able to speed up your WordPress site by periodically optimizing your WordPress database to remove post revisions and other gunk.

For this reason, some WordPress hosts, like WP Engine, will automatically disable revisions on all the sites hosted there.

But if you want or need to do things yourself, there are two main ways to modify the WordPress post revisions functionality:

  • Change how many revisions WordPress stores. You can, for example, cap the revision number at 10 so that WordPress deletes older revisions once it reaches 10 stored revisions.
  • Completely disable revisions. We’d recommend limiting revisions over completely disabling them. But it is possible to completely disable the revision functionality.**
    **
    Even if you disable post revisions, your database will still store all the revisions from before you disabled them. To fix this, you can use a database cleaner plugin.

To perform both these actions in the most user-friendly way possible, the free WP-Disable plugin is a great option:

It lets you manually adjust or disable the number of stored revisions. To use it:

  • Install and activate the plugin from WordPress.org (here’s how to install WordPress plugins)
  • Click on the new Optimisation.io tab in your WordPress dashboard
  • Go to the Admin tab in the plugin’s interface
  • Use the drop-down beside Post revisions number. You can choose a number of revisions to save or select 0 to disable revisions

the wp-disable plugin helps you modify or disable revisions

How to modify WordPress post revisions via wp-config.php

We don’t recommend this option for beginners (stick to the plugin above). But if you’re comfortable editing your site’s wp-config.php file, you can also modify WordPress post revisions using WP_POST_REVISIONS.

To modify the number of revisions, use this code snippet:

define( 'WP_POST_REVISIONS', 3 );

Replace the number 3 with the desired number of revisions.

Or, to completely turn off post revisions, you can set it to false:

define('WP_POST_REVISIONS', false);

Wrapping things up

WordPress post revisions are a handy feature that allow you to quickly compare or restore older versions of your posts.

While they are helpful, and we wouldn’t recommend completely disabling them, they can clutter up your database if you constantly edit posts.

For that reason, we recommend using the WP-Disable plugin or editing your site’s wp-config.php file to cap the number of revisions. A number like 10 is a good starting place.

Have any other questions about post revisions in WordPress? Leave a comment and we’ll try to help out!

Yay! 🎉 You made it to the end of the article!

0 Comments
Inline Feedbacks
View all comments

Or start the conversation in our Facebook group for WordPress professionals. Find answers, share tips, and get help from other WordPress experts. Join now (it’s free)!