How To Disable Post Revisions In WordPress

Post revisions are a favorite feature among bloggers and writers in the WordPress community. Post revisions in WordPress allow you to create a backup of your post through saving or updating the post. However, depending on how much you write or what your editing flow is, you may not make use of post revisions. The issue with this? Your filling up your website’s database. By disabling post revisions, you can reduce your database size drastically, which in turn, can speed up your website.

How To Disable Post Revisions in WordPress

To disable post revisions, you need to open your wp-config.php file and add the following lines.

define(‘AUTOSAVE_INTERVAL’, 300 ); // seconds
define(‘WP_POST_REVISIONS’, false );

The above code will disable all future revisions. The above code also increases your autosave interval which can reduce the impact on your database by increasing the interval from 1 minute to 5 minutes.

However, the above code will not clear out older post revisions. I will show you how to remove older post revisions below.

How To Delete Old Post Revisions in WordPress

If you want to clear out past revisions, you can do this in a couple of ways. The first and most obvious way is to use a plugin such as WP-Optimize or WP Sweep. Both of which are free and easy to use to clear out all your revisions.

However, if you would like to do this without a plugin, you can open up your database in PHPMyAdmin and run the following SQL query.

DELETE FROM wp_posts WHERE post_type = “revision”;

Closing Thoughts

There are many times where post revisions might be useful for your website. I am not suggesting you disable them for every website, however there are many situations where you might not want post revisions, like a slow host. If you do not want to disable post revisions, which is totally understandable, I at least would clear out older post revisions. They can clutter your database and impact the overall performance of your site.

scott hartley

About the author

Scott is a web performance geek, lover of all things coffee, and avid video game player. His WordPress work delves into web performance, web security, and SEO.

Leave a Comment