How To Disable Post Revisions In WordPress

Home » WordPress Tutorials » How To Disable Post Revisions In WordPress
  • disable post revisions in wordpress

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 do 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.

By |2019-01-10T20:12:26+00:00January 10th, 2019|Categories: WordPress Tutorials|Tags: , |0 Comments

About the Author:

Scott Hartley is a WordPress Developer who focuses on website performance optimization, SEO, and security. He can't tell you what a color wheel is but he knows the intricacies of making a website load quickly.

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.