Home Internet Disable or delete post revisions to minimize WordPress database

Disable or delete post revisions to minimize WordPress database

Large blogs or websites, with hundreds and thousands of content articles, built on 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 “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.

Disable/delete Revisions to minimize WordPress database

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.

USE wordpress_database_name;
DELETE FROM wp_posts WHERE post_type = "revision";

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 creation of any revisions from the very start. Add the following line into wp-config.php file.

define('WP_POST_REVISIONS', false);

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

By admin in Internet with no comments on .

This guide has neighbours too! Do not forget to ring their doorbells.
« How to Register a DLL
Backup and restore in Windows 7 »