WordPress Revisions & Autosave

Video Transcript

In this video, we’re going to cover WordPress’s auto-backup, auto-save, and revisions features that take place in the post and page editors while you’re creating your content. Now as you’re working in either your post or page editor, WordPress is quietly protecting your hard work behind the scenes by constantly saving your content every two minutes as an auto-save. Now in between those two-minute intervals, WordPress is doing a quick backup. So in the event your browser crashes or the power goes out and your computer shuts down, not to worry; your work has been saved. And all you need to do is after you restart your computer, log back into WordPress and go to the editor of that post or page. And I’ll show you what I’m talking about here through a little demonstration in just a second.

Now the other feature we’re going to be covering in this video is revisions. Now this takes place every time that you hit the Update button after you’ve already published your content. So let me show you that one first. Let’s go ahead and log into our Admin area, which I’ve already done here, and come on over to Post. And again, everything that I’m going to be showing you in Post can be done in Pages as well. Let’s go ahead and add a new post. And by the way, you can also come on up here to the Admin Toolbar. And when you hover over New, you can just click on Post, and that’ll take you to the same spot. So let’s go ahead and give our demo post a title and some demonstration content, and of course, anything else that you might want to put in there – links, images, whatnot. It doesn’t matter. As you can see here in the lower-right corner of our Editor window, this draft has been saved. And you can see here it just changed. And that’ll take place every two minutes.

Now then let’s go ahead and demonstrate the revisions. Right now in the Publish box, there’s nothing in here referencing revisions. And the revisions will be displayed down below the editor box. But until you actually publish this, there’s not going to be any revisions down there. As a matter of fact, if we go to the Screen Options tab and hit that, there’s no revisions option up here until you actually click on Publish. So let me go ahead and demonstrate that. Now we’ve clicked on Publish. And let’s add some more content here. Click on Update, and now you’ll see that the revisions will start adding up right here in the Publish box as well as below the editor window right here. Now this Revisions box can be displayed or collapsed by hitting that drop-down arrow or removed altogether up here in the Screen Options tab as you can see here. Now the revisions option is available that you can toggle on or off as you so desire.

Now as far as revisions, WordPress, by default, allows for an unlimited number of revisions, which can be good but can also be terrible because each one of those revisions is saved in your database. And as an example, whenever I’m creating a sales page for one of my WordPress sites, I may revise that 10, 20, 30, or more different times because I found a different image or I wanted to add another benefit or change the icons that I’m using to highlight or bullet-point those different features. And as I make those updates, those revisions are going to add up. And if I do that on a regular basis with several posts and/or pages, after a while, my database is going to get all fat and bloated, and that’s going to affect the load time when my visitors start hitting up my WordPress site. Well, that’s not a good thing. So what you might consider doing is what I’m about to show you, and that’s to change the unlimited number of revisions that WordPress has by default to a limited number – like maybe 5 or 10 revisions, and that’s it. Okay, so that’s the revisions.

Let me show you the auto-save and auto-backup. And then I’m going to show you how to adjust the code to limit the number of revisions from unlimited to five or six. And you can make whatever adjustments you want there on that particular number. But let’s go and add some more content here. And again, you’ve got the auto-save down here that’s being displayed. But let’s go ahead and simulate a power outage or a browser crash. Okay, so as you notice, I did not click on the Update button to save that additional paragraph I tossed in there because, well, I couldn’t. The power went out. So I’ve restarted the computer. I’ve logged back in. And I’m going to go back to that post. You can see here that paragraph is not there. But I’m given this message up at the top that backup of this post in your browser is different from the stuff down below. You want to restore what was auto-backed up? Well, heck, yeah, I do. I don’t want to have to retype all that stuff. Click on Restore the Backup Link, and there you are, very cool stuff. Okay, so that’s the auto-backup that takes place in between those two-minute intervals that WordPress does the auto-save.
Let’s toss in some more content here. And let’s give a little more time so that I can activate the auto-save and not the auto-backup, which is going to be right around the two-minute mark. And I’ll edit this part of the video, so you’re not going to sit there twiddling your thumbs for the next minute and some odd seconds. And now let’s go ahead and simulate that power outage, and come on back to our post. And now you see we have this message saying that there was an auto-save of the post. As you can see, all the additional content has not been saved. But I can get all that back by just simply clicking on View the Auto-Save. And by the way, an auto-save is very similar to revisions. So whenever we check out the revisions here, it’s going to take us to the same spot that I’m about to show you here. This is where we can restore the revisions and/or auto-saves. But right now we’re in the auto-save section. So you can see this is what was shown to us in the editor after we finished up restarting the computer, logged back into WordPress, and came back to our post or page editor. Over here is that same content, only the part that was auto-saved is highlighted in green. So if you want to keep this, then just go ahead and click on Restore this Auto-Save, and there we are.

Now then we want to check out some of those revisions. Just come on up here to the Publish box, and click on Browse. That’s going to bring us back to the Revisions page. And we can use this slider here to view the various revisions. And remember, the revisions were created each time that we clicked on that Update button after we published that post or page. So we can see the various revisions here. And if you want to compare, then you can check this box here to compare any two revisions. So that’s a look at our revisions, auto-save, and auto-backups.

Now I want to show you how you can adjust the default unlimited number of revisions that WordPress allows to a specific or a limited number of revisions. And to do that, I’m going to log into my cPanel control panel. Come on down here to File Manager. And we’re going to edit the wp-config.php file. Now you can do the same thing with an FTP client if you’re more comfortable using FTP than you are with cPanel. But this is easier for me. And for me, easy is always good. So let’s go ahead and select that wp-config.php file. Come on up here to either Code Editor or Edit. They’re both going to do the same thing, only Code Editor has numbers on the left-hand side and Edit doesn’t. So let’s go ahead and open that up. Come on down here to where it says define( ‘WP_DEBUG’. And just below that, go ahead and add the following code. And you don’t have to worry about pausing the video to make sure you get this copied down right. I’m going to include this in a copy and paste text document along with this video. And this is the number that you can adjust. Right now this is saying to limit the number of WordPress post or page revisions to 5 instead of the default unlimited number. But you can adjust this number to whatever you want. Just make sure it’s only the number you’re changing and not the parentheses, the comma, or any of this other stuff. Otherwise, you’re standing a chance of breaking your site, and that’s not a good thing. And then you can just go ahead and click on Save, and we’re solid. That’s it. Let’s come on back to our post editor.

And that’s going to bring us to the end of this video on revisions, auto-saves, and auto-backups. Thanks for watching and you have a great day.