Your Guide to the Autosave Feature for WordPress Posts
If you write blog posts in your browser, you have probably had the gut-wrenching experience of losing content.
Maybe your browser crashed. Perhaps your internet connection dropped.
But when you went back to your post, your content was missing. Ouch!
Fortunately, autosaves are a WordPress feature that can help you avoid losing your content.
As you write a post, WordPress will save a copy of your content every 60 seconds. This saved copy will update every 60 seconds. WordPress only stores one autosave at a time.
The autosave feature relies heavily on the revisions feature in WordPress. So it's worth reading our guide to revisions if you want to understand autosaves in more detail.
How to use the WordPress autosave
If your browser crashes, or your internet fails, go back to your post editing screen. Your experience will differ slightly depending on whether your post is published or not. This is because WordPress has a slightly different approach to autosaves for published and unpublished content.
How to use autosaves for unpublished posts
If your post is not yet published (in “Draft” or “Pending Review” statuses), you will see this message:
“The backup of this post in your browser is different than the version below.”
If you click the “Restore this backup” button, WordPress will automatically restore the autosave. You won't need to do anything else.
How to use autosaves for published posts
This process will be different if your post is in the “Publish” status. You will see this message:
“There is an autosave of this post that is more recent than the version below.”
If you click the “View the autosave” link, you will be taken to the revision comparison screen. Your autosave will be labelled “Autosave” and marked in red. This helps it stand out from other revisions.
Click the “Restore This Autosave” button and you will have your content back.
How autosaves work for published and unpublished content
WordPress autosaves are stored in the site's database. All autosaves create a new entry in the
wp_posts table, but the format is different for unpublished and published content.
How autosaves work for unpublished content
Autosaves for unpublished content are stored as a variation on the original post, simply with a different status.
Here are some database details for autosaves on unpublished content:
post_statuscolumn is set to “auto-draft“.
post_titlecolumn is set to “Auto Draft”.
post_typecolumn uses the type from the original post so it may be
How autosaves work for published content
Autosaves for published content are saved as revisions. This is why you have to click the “View the autosave” link and visit the main revisions screen.
Here are some database details for autosaves on published content:
post_statuscolumn is set to “Inherit“.
post_titlecolumn is set to the title you seen on the post editing screen.
How to disable or change the autosave feature
Some hosting companies believe the autosave feature can take up too many server resources. There is some truth to this because every autosave does require writing to the database. You may also have a slow internet connection and find that the autosaves slows down your browser every 60 second.
If you want to change the autosave time, you can add this to your wp-config.php file:
Make sure to add this towards the top of the file, above this line:
/** Absolute path to the WordPress directory. */
The “600” refers to the number of seconds, so with this code I'm forcing the autosave to happen every 10 minutes. The default WordPress setting is “60”.
If you set this number to 10000, you are disabling the autosave feature because you will need to have you post open for a whole day before it runs once.
Also, there are also plugins to help you automatically delete old revisions.
Limitations of the autosave feature
Autosaves are only as good as the revisions feature they are built on.
Not all plugins support the revisions feature in WordPress. In fact, some plugins such as WooCommerce will actively avoid using revisions. If you make changes to a WooCommerce product, that data will not be stored in revisions.
So if your plugin doesn't support revisions, it won't support autosave either, and some of your data may be lost. With custom post types that don't support revisions correctly, it may not be possible to use autosaves at all.
The difference between revisions and autosaves
Revisions are a feature that you may use very regularly on your WordPress. I hope that autosaves are something you need only very rarely.
There some other key differences:
- You can have 100's of revisions but only one autosave.
- Autosaves happen automatically, where as you have to click “Save” or “Update” to create a revision.
- Revisions reflect changes to your actual post. Autosaves don't impact your post.
- Revisions will change the Last Modified Date of your content, but autosaves will not.