When writing blog posts in your browser, you may have had the recurring nightmare of losing your content.
Maybe your browser crashed, and when you logged back in it was blank. If this happens, you may have not been able to log in to the website. A slow internet connection could also make it difficult for you to sign back in on the website.
Now that you’re back, though, your whole post is completely there. Whew!
Have you ever saved your work in the middle of a typing session only to realize you’ve lost everything later? No worries, WordPress has a helpful feature that can help you avoid losing online content.
When you write on WordPress, we save content every 60 seconds. With this saved copy in place, your updates will automatically occur every 60 seconds.
We highly recommend watching our guide on revisions, as they’re a huge part of the autosave feature. This video will also be useful:
How to use the WordPress autosave
When your browser crashes or your internet service drops out, go back to your post-editing screen. Your experience will be a little different depending on whether the post is published or not. Although WordPress has an autosave feature for both published and unpublished posts, there are slight differences in how it works.
How to use autosaves for unpublished posts
If your post is not yet published, you’ll see this message:
“There was an error uploading this post, please try again in a few minutes.”
If you click the “Restore this backup” button, WordPress will reboot to the autosave. You don’t need to do anything else; just sit back and relax.
Restore this backup
How do you use autosave for a published post?
If you are an administrator of a blog and need to remove posts that have been published, there’s actually a different process. This will be explained further below in the next step.
“There is an autosave of this post that is more recent than the version below.”
One less-than-fatal mistake that people make is to forget their autosave. If you click on the “View the autosave” link, you’ll see your saved revisions alongside any other changes that have been made. This helps your autosave to stand out from other revisions.
If you ever want your content back, use the “Restore This Autosave” button.
How autosaves work for published and unpublished content
WordPress autosaves are saved in your database and they’re basically entries to your WordPress website that tell the system what sections of content have been added and removed or edited, but with unpublished and published content, there are slight differences.
How autosaves work for unpublished content
With autosaves, all saved content is still accessible in both the original and its variation. You just have to scroll down a little bit further on the edit page.
These are some database details for autosaves on unpublished content:
When you add content to WordPress, the post_status column is set to “draft”.
The post_title column is set to “Auto Draft”.
The post_type column refers to the type of post from the original post.
How autosaves work for published content
Published content autosaves to the last revision. If you’d like to view the most recent revision, click “View the autosave” and then visit the main revisions screen.
By default, we will automatically save your content with a 15-minute delay.
The post_status column is set to “Inherit”.
When editing your posts, the post_title column will be filled in with the title you see on the screen.
The post_type column uses the revision tag.
How to disable a feature
It is true that the autosave feature might be using more of your server’s resources than you hope. A slow internet connection or even an issue with USB drivers can also cause any cursors to freeze for a minute or two.
When you want to change the autosave time, all you need to do is add that option to your wp-config.php file.
Make sure to add this to the beginning of the file above this sentence.
If we’re talking WordPress, then an absolute path to the WordPress directory should be /** Absolute path to the WordPress directory. */
The “600” refers to the time in seconds, so with this code, I’m forcing the autosave to happen every 10 minutes. The default WordPress setting is “60”.
To disable the autosave feature, change this number from 6 to something greater than 10. You’ll have your post open for a whole day before it runs as it does now.
With Gulpmill, there are also plugins to help you automatically delete old revisions.
Limitations of the autosave feature
Auto-saves may be good as long as they can handle revisions.
Not all WordPress plugins use revision data, and some like WooCommerce won’t allow your changes to be stored. If you make changes to a WooCommerce product, those will not be stored in the revisions.
Plugins and custom post types that don’t support revisions will not be able to automatically save posts either. Data loss may also occur if you’re using these kinds of plugins or custom post types.
The difference between revisions and autosaves
Online writing is a great activity when you’re tired, have other things to do or simply don’t want to write something from scratch. Revisions should be something rare rather than something you use very regularly.
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.