How to Manage WordPress Post Revisions

How-to-Manage-WordPress-Post-RevisionsPost revisions in WordPress ensure that your post is periodically saved while editing your published posts. This allows you to compare older revisions with a newer one to understand the changes you made. Post revisions are especially useful when you have multiple authors and want to keep track of the changes they make.

Post revisions were added for two main reasons:

∎ To prevent data loss

∎ To improve editorial workflow

Computers are weird devices and you cannot predict what happens to this amazing machine. Sometimes a small problem can erase all the data. You don’t want to lose all the hard work you did, don’t you? So, post revisions ensure that all your work in WordPress is saved, even if your browser crashes or your system fails.

As mentioned earlier, post revisions van help to improve the editorial experience for all. You can track changes to your posts and can revert back if you find older version good. Even if you deleted a part of the post, with post revisions you can ‘undo’ it.

WordPress introduced this feature from WordPress 2.6 version onwards. Although this feature can be handy sometimes, they can slow down the website. The revisions are saved in a separate database on the server and use precious space. If you have many posts, chances are that there may 12 or more post revisions per post. This considerably depletes system resources. Also, a post may be updated several times and you may not want many revisions in the database.

The good news is that you can limit or delete post revisions. You can either use dedicated plugins or enter some codes in your wp-config.php file. If you are too afraid to play with codes, go for plugins.

1. Editing wp-config.php file

Go to wp-config.php located in your WordPress root directory and add the following code:

define('AUTOSAVE_INTERVAL', 600 ); // Time in seconds
define('WP_POST_REVISIONS', true );

Here, you can edit the code in three ways:

define('WP_POST_REVISIONS',  )

∎ true or -1: This is the default option in WordPress and autosaves post revisions.

∎ false or 0: This deletes revisions entirely and limits you to the most recent autosave per post.

∎ a number greater than 0: This limits your post revision count to the specified number and deletes older revisions. For example, if you set the number as 5, the database stores the latest 5 post revisions.

The AUTOSAVE_INTERVAL sets the time for saving post revision. In the above code, 600 seconds means that it will autosave your post every 10 min.

You can also delete all previous revisions from PHPMyAdmin by running the following SQL query.

DELETE FROM wp_posts WHERE post_type = "revision";

2. Using plugins



WP-Optimize enables you to trim a lot of junk from your WordPress database. It can clear all the unnecessary revisions on the go. You can create custom schedules to run the plugin. The plugin can also clean unwanted draft posts, trashed comments, unapproved comments and much more.

Optimize Database after Deleting Revisions

Optimize Database after Deleting Revisions

The Optimize Database after Deleting Revisions plugin helps you to delete older post revisions. The plugin can be used manually or set to run on a schedule. It creates its own log files for later analysis and enables you to choose which revisions to be excluded while cleaning.

Wrapping Up

Post revision is an amazing feature of WordPress. Post revisions do not impact site performance. Many studies have confirmed that post revisions have little or no impact on site performance.  If you think this feature takes a large portion of the database, you can disable or limit this feature by above-mentioned methods.

Follow Search Engine Nation for news and latest updates on SEO, SMO, SMM, Email marketing and more.

No votes yet.
Please wait...
Voting is currently disabled, data maintenance in progress.

Leave a Reply

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

%d bloggers like this: