How To Disable Post Revisions and Autosave on WordPress
WordPress has a “Post Revisions” feature that automatically stores in the database various versions of your posts, so that you can roll back to earlier versions if necessary.
This is a useful feature in some situations. For instance, if you accidentally erase the content of a post you would be able to get an older version. Similarly, if you have multiple authors on your blog this feature might help to fix undesired changes or edits to some of the posts.
That being said if you are the only person posting on your blog and if you are careful when editing the posts you might find that you’ll never use the post revisions feature. If this is the case I suggest that you turn it off, as by doing so you will be reducing the number of entries on your database.
Suppose that, on average, each post ends up having five saved revisions. This means that a blog with 1000 posts would have 6000 entries in the database (1000 for the posts and 5000 for the revisions). In other words, you could be saving some space and improving the performance of your database queries (even if slightly).
To disable post revisions simply add the following code to your wp-config.php file (remember to back it up before making any changes, in case anything goes wrong):
define('WP_POST_REVISIONS', false );
Another change you can make is to increase the time interval of the auto-saves on your posts, as it can be annoying, specially on slow connections. The default is 60 seconds (i.e., WordPress auto-saves your posts every minute). If you want to increase it to 180 minutes (i.e., 3 minuteS), add the code below to the same wp-config.php file:
define('AUTOSAVE_INTERVAL', 180 );
Finally, you can also remove all the existent post revisions from your database, but I wouldn’t recommend doing it unless you are quite familiar with MySQL and databases. There are some “database cleaning” plugins around as well which could be used for this purpose.
5 Responses to “How To Disable Post Revisions and Autosave on WordPress”
Now this is something I planned on doing for a long time, these revisions are killing me. Will also try the MySQL deletion, I hope I won’t mess it up too much 😀
I think I don’t want to do this tweak yet since Post Revisions saved my posts many times. But it’ll be useful in the future when I don’t do any mistakes in refreshing while writing, browser closing etc. 😉
Aren’t these revisions get removed automatically after long days?
I’ve already used the new revision feature twice. Its awesome because I’m on cheap hosting so the site can lag sometimes. The best part is that it’s auto revision so I didnt even have to set it up.
Great post, Daniel! I never use this new revision feature and I am all about speeding up my blog so I will have to probably use your guide for my blogs. I wonder if WordPress can adjust this feature some other way to make it not so crazy on the database?
Thanks for the tip – good to know.
Post revisions have saved my butt several times, so I think I will be keeping it. Might not be a bad idea to increase the autosave interval time though.
Comments are closed.