How To Use WordPress Autosave And Post Revisions

Learn how to use the WordPress autosave and post revisions feature to restore and recover content revisions in your posts and pages …

How To Use WordPress Autosave And Post Revisions

Girl staring at laptop looking frustrated.In this tutorial, you will learn how to use the WordPress autosave and post revision feature.

Have you ever been in a situation where, after spending much time and effort composing or editing an article, something goes unexpectedly wrong, your computer suddenly crashes, and you find that you have lost all of your hard work because you forgot to click the ‘Save’ button at regular intervals?

If this ever happens while working on your website, don’t despair. WordPress comes with a powerful built-in content recovery feature that:

  • Helps to prevent losing your work by automatically saving earlier versions of your posts and pages,
  • Restores your post or page content if something unexpectedly causes your computer or web browser to crash while you’re working, and
  • Lets you recover and restore an earlier version of your posts or pages if you changed the content and want to go back, even after saving.

Why You Need The WordPress Autosave & Post Revisions Feature

Typically, after editing and saving a post or page, you will see a confirmation message letting you know that your post or page has been saved and updated successfully.

Edit Post - Post updated. View post message.
This post has been updated successfully.

Sometimes, however, things can and will go wrong.

The WordPress autosave and post revisions function ensures that your content is periodically saved at regular intervals, so you can revert to an earlier version, or recover, and restore your content if something unexpected were to happen, such as:

  • Your internet connection/wi-fi/modem temporarily goes down.
  • Your web browser crashes or freezes.
  • A power outage occurs.
  • Internet “gremlins” temporarily prevent you from saving or publishing your work.

If this happens and you try to save your work, you may see a ‘WordPress Failure Notice’ on your screen.

WordPress failure notice: Are you sure you want to do this? Please try again.
Uh oh … what’s happened to the post you were working on?

If you get the message Are you sure you want to do this? Please try again. and click on the link, the post or page you were working on should return to your screen, minus any recently made changes.

Alternatively, you could see a screen like the one below, depending on what you were doing…

WordPress failure notice - The link you followed has expired. Please try again.
Here’s another WordPress failure notice that can affect the post you were working on.

This is where the built-in WordPress autosave feature comes in handy and can help to avert a disaster, or at least save you a great deal of grief and frustration.

WordPress Autosave

The autosave function is automatically enabled for all WordPress posts and pages but does not overwrite any content that you have already published or are working on.

Post Revisions - Autosaved post.
WordPress autosaves your posts at regular intervals.

Autosaves are stored in your WordPress database as a special kind of revision.

By default, WordPress automatically saves the current version of your posts to the database every sixty seconds. This time interval can be changed by modifying code in your wp-config.php file.

Warning

We recommend making a complete backup of your site’s files and database before making any changes to website files in your server.

If you need help or assistance changing the time interval of your site’s autosave function, please contact your web host.

***

If you were working on your post for a while and something were to happen (e.g. your browser crashes or internet connection temporarily drops, you may see a There is an autosave of this post that is more recent than the version below‘ notice when you return to your post or page editing screen.

Edit Post - WordPress autosave notification: There is an autosave of this post that is more recent than the version below. View the autosave.
Edit Post – WordPress autosave notification.

Click on the link to view the autosaved version of your post or page.

Edit Post - View the autosave link.
Click the View the autosave link.

You will be taken to the Compare Revisions screen, where an autosaved version of your post or page can be recovered.

Compare revisions screen.
WordPress lets you compare different saved revisions of your post.

WordPress offers one-click content recovery and restoration. Click the Restore This Autosave button.

Restore This Autosave button.
Click this button to restore your autosaved post revision.

The autosaved content you were previously working on will be restored.

Edit Post - Post restored to revision message
Your post is now restored from autosave.

WordPress Autosave – Additional Information

Content Recovery – Session Expired

Sometimes, your login session will simply expire while you are still working on your content. When this happens, a ‘Session expired’ message should pop-up on your browser.

WordPress - Session expired message.
Session expired message.

If your login session expires and you get logged out of your site, WordPress remembers where you were, so when you log in again, you can continue working from where you left off.

WordPress notice - Your session has expired. Please log in to continue where you left off.
Log in again to continue working where you left off.

WordPress autosave is also useful if you leave your site without saving your latest changes.

WordPress message - Leave site? Changes you made may not be saved.
If you click the Leave button, you may be able to recover unsaved changes with WordPress Autosave.
Content Recovery – Loss Of Internet Connection

As well as the Autosave function, WordPress also saves your latest revisions temporarily in your web browser.

For example, WordPress can help you recover content if you lose your internet connection …

No internet error message.
WordPress autosave and post revisions can recover your content if you lose your internet connection.

It can also help you recover your content if you get a ‘Connection lost’ message like the one shown below:

Connection lost. Saving has been disabled until you're reconnected. We're backing up this post in your browser, just in case.
Many different factors can lead to seeing this Connection lost screen notification.

If you lose your internet connection while writing, your drafts are saved locally to your browser. When you return to edit, WordPress notifies you if there is a more recent draft, allowing you to restore the most recent version of your content.

Recover your content after losing your internet connection.
Lost your internet connection? No problem! WordPress lets you recover your content.

This function is useful in case something happens between autosave intervals.

If the backup of the post that you are currently working on which has been saved in your web browser is different from the version displayed in your content editor, WordPress gives you the opportunity to restore your saved backup version.

Edit Post - Restore post backup notice - The backup of this post in your browser is different from the version below.
WordPress restore post backup notice.

Click on the Restore the backup button.

WordPress Edit Post screen - Restore the backup button.
Click the button to restore the backup saved in your web browser.

Your post content will be restored successfully. You can use undo and redo in your content editor to get the old content back or return to the restored version.

WordPress Post Revisions

WordPress introduced its Post Revisions feature in version 2.6. When you save a post or a page, WordPress automatically creates a revision of your post or page and stores it in your site’s database.

After version 3.6, WordPress made significant enhancements and improvements to this feature. The current WordPress revision system now includes an option in the Post/Page Publish box called Revisions. This automatically calculates and lets you know at a glance how many revisions you have made to your content.

It also lets you quickly and easily access the ‘Revisions’ screen by clicking on the Revision: Browse link (if using the WordPress Classic Editor.)

WordPress Publish box - Revisions
Click the Revisions: Browse link to view your saved post revisions.

Note: In the WordPress Block Editor, the Revisions feature can be accessed in the Document sidebar.

WordPress Post Revisions - Block Editor
WordPress Post Revisions – Block Editor

This brings up the Compare Revisions screen.

WordPress Compare Revisions screen.
Compare Revisions screen.

Tip

Note: This feature is identical for both Posts and Pages and works the same way in the WordPress Classic and Block Editors.

How To Compare Revisions – Revision Slider

When you compare different post or page revisions, a Revision Slider allows you to move through your saved revisions. The more revisions you have saved, the more revision markers or segments will display on your screen and the longer your revision slider will be.

Comparison of post revision sliders.
The more revisions you have, the longer the slider.

Your current revision displays on the far right-hand side of the slider.

Revision slider - Current revision.
This is your current revision.

When you make changes to your content and update your posts or pages, your revisions appear in the revision slider marked in black, along with the save interval, time, and date of the revision.

Revision slider - Previous revision.
This is a previous revision.

Revisions saved automatically by WordPress show up in the revision slider highlighted in red, along with the save interval, time, and date of the revision.

Revision slider - Autosaved revision.
This is an autosaved revision.
WordPress Revisions – How to Use The Revision Slider

You can navigate between different revisions by either moving the slider to the left (older revision) or right (newer revision) or by clicking on one of its segments to go directly to that post or page revision.

Post revision slider - animated image.
Move the revision slider button to the left or right or click on a revision segment to jump to that post revision.

There are also buttons you can use to navigate between revisions.

Click ‘Previous’ to go back and inspect older revisions.

Compare Revisions screen - Previous button.
Click the Previous button to view older post revisions.

Click ‘Next’ to advance to newer revisions.

Compare Revisions screen - Next button.
Click the Next button to view newer post revisions.

In addition to inspecting adjacent revisions, you can also select and compare any two revisions side by side.

To do this, tick the ‘Compare any two revisions’ checkbox.

Compare any two revisions checkbox enabled.
Tick the box to compare any two revisions.

This lets you adjust two slider buttons independently and compare any two saved revisions.

Compare Revisions screen with compare any two revisions checkbox enabled.
Compare two different post or page revisions.

When you find the saved revision that you would like to restore, click the Restore This Revision button.

Compare Revisions screen - Restore This Revision button.
Click the button to restore your selected revision.

To cancel the operation and return to the current saved version of your post or page without restoring any revisions, click on the post or page title link.

Compare Revisions screen with title highlighted.
Click the post or page title to return to the editor.

You can exit the Compare Revisions screen and return to the content editor without making any changes by clicking the Return to editor link.

Compare Revisions screen - Return to editor link.
Click the Return to editor link to go back to editing your post or page without making any changes.

WordPress Post Revisions – Additional Information

You can make changes to the WordPress revisions function, like changing the autosave interval (or even disabling the feature altogether), but this typically requires editing code in WordPress core installation files.

Contact your web host if you need any help making changes to WordPress autosave or post revisions.

Let’s focus now, on some areas of the WordPress post revisions feature that do not involve editing code.

Viewing The WordPress Post Revisions Box

As soon as you create or edit and update (i.e. save) a post or page, WordPress begins to store content revisions in its database. These are displayed in a Revisions box below your post or page editor (if using the WordPress Classic Editor.)

WordPress Revisions box.
The WordPress Revisions box displays a list of all your post revisions.

If you can’t see the Revisions box in the Post or Page editor screen} click on the Screen Options tab at the top right-hand corner of your screen.

Post Editor - Screen Options tab
Click on the Screen Options tab to enable Post Revisions.

Enable the ‘Revisions’ checkbox in the Boxes section.

Post Editor: Screen Options - Boxes - Revisions checkbox
Enable the Revisions checkbox in your Screen Options area.

You should now see the Revisions box displayed below your content editor. Click any of the links to bring up the Compare Revisions screen with the saved information for the selected item.

Revisions meta box
The Revisions meta box.

Information

As mentioned earlier, WordPress does not save any revisions until you actually save a change in your post or page. If this happens, you will not see the ‘Revisions’ module in the Boxes section of the Screen Options tab until you make changes to your post or page.

WordPress Screen Options - No revisions checkbox
Until you save your post or page changes, the Revisions checkbox will not display.

Once you have made changes to your content and saved these, the Revisions box should appear in the Boxes section of your Screen Options tab.

WordPress Screen Options - Revisions checkbox
The Revisions checkbox will display once you save changes to your post or page.

Please note, that some hosts disable the WordPress Post revisions to reduce the amount of data saved in your site’s database and free up hosting space.

The WordPress Revisions feature can be turned off by editing code in the WordPress wp-config file.

wp-config.php - post revisions off
Post revisions have been turned off for this site.

If you cannot see the Revisions feature on your site, your host may have turned it off.

Post Revisions can be turned on by opening your wp-config.php file and changing the following line:

define( 'WP_POST_REVISION', false );

to

define( 'WP_POST_REVISION', true );

wp-config.php - post revisions on
Post revisions are turned on and working on this site.

Additionally, some hosts may limit the maximum number of revisions your WordPress site can store in its database.

For example, in the screenshot below, the site has been limited to a maximum of 5 post revisions.

wp-config.php - post revisions limited.
This web host has limited this site to a maximum number of post revisions.

If you are uncomfortable editing code in your server files and need help, please contact your web host.

Managing  Post Revisions Using Plugins

Having effective workflow features like WordPress autosave and automatic post revisions is no doubt a good thing and can make your content writing more productive and efficient.

If you write and edit a lot of content, however, the number of revisions can start to add up after a while. This can significantly bloat the size of your WordPress database, so it’s important to also be able to manage your revisions.

Revisions meta box with loads of saved post revisions.
Post revisions can really add up after a while, storing unnecessary data in your WordPress database.

For example, if you have published 100 posts on your site and each post has an average of 15 revisions, your WordPress database could be storing an extra 1,500 copies of unnecessary data.

If your posts averages 100KB data, then with 1,500 revisions, the total database space wasted is about 150MB.

Fortunately, there are a number of free WordPress plugins that can help you manage your revisions and reduce the size of your database.

For example, you can install a free plugin like Simple Revisions Delete to help you keep a clean database by removing unnecessary posts revisions.

Simple Revisions Delete
Simple Revisions Delete – WordPress plugin

This lightweight and simple-to-use plugin lets you purge (delete) your posts revisions either individually or all at once.

Once the plugin has been installed and activated, for example, a ‘Purge’ link appears next to the Revisions section in your Publish box (and in other sections of your admin area) allowing you to safely delete revisions.

Publish box - Revisions: Purge link.
Click the Purge link to delete post revisions from your WordPress database.

To learn more about WordPress plugins that will help you manage your post revisions, go here: WordPress Plugins For Managing WordPress Post Revisions

If you need help installing plugins on your site, see this tutorial: How To Install WordPress Plugins

Congratulations! Now you know how to use the WordPress Autosave and Revisions feature to recover and restore previously saved versions of your content.

WordPress post revisions screen.
Learn how to use WordPress autosave and post revisions.

***

"This is an awesome training series. I have a pretty good understanding of WordPress already, but this is helping me to move somewhere from intermediate to advanced user!" - Kim Lednum

***

We are not affiliated, associated, sponsored, or endorsed by WordPress or its parent company Automattic. This site contains affiliate links to products. We may receive a commission for purchases made through these links.