Large blogs or websites, with hundreds and thousands of content articles, built on the WordPress platform may experience rapid growth in their database sizes.

Furthermore, blogs, where most of the posts are updated quite frequently, may experience an accelerated database size enlargement.

The key reason for the above-stated problem is WordPress keeps an older version of your post as a “revision” document whenever it is updated. Hence, every update in a post will create a new revision.

This process may lead to numerous revisions in your database – and may so happen that the number of revisions is more than the actual posts.

If you’re sure that the WordPress revisions aren’t needed, you can delete them via the following SQL command:

Caution: Do take a database backup before executing the below SQL command. The modifications can be reverted if something goes wrong.

[sourcecode language=”sql”]
USE wordpress_database_name;
DELETE FROM wp_posts WHERE post_type = “revision”;
[/sourcecode]

The revisions can also be permanently disabled by updating the wp-config.php file. This can also be performed as a preliminary step during WordPress installation in order to avoid the creation of any revisions from the very start. Add the following line to the wp-config.php file.

[sourcecode language=”php”]
define(‘WP_POST_REVISIONS’, false);
[/sourcecode]

Collecting revisions for a post is mostly a not-so-important requirement for many.