Disable WordPress post revision

WordPress 2.7 build-in revision feature to save all backup articles (or you may call posts). However, the backup articles almost will not be used and a lot of database storage is wasted. Therefore, I disabled revision feature in my blog. Here is the solution to turn this feature off.

  1. Edit wp-config.php that is saved in WordPress root directory.
  2. Add the following red statement at wp-config.php. It’s suggested to add the red statement at the last 2 line (before ?>).
    ...........
    require_once(ABSPATH . 'wp-settings.php');
    define('WP_POST_REVISIONS', false);
    ?>

If you have wrote many articles previously, I believe your database has already stored many unnecessary articles. To release the storage, it is suggested to remove the existing revision articles.

  1. Go to phpMyAdmin
  2. Click SQL button:
    phpmyadmin_sql
  3. Enter and submit the following SQL statements:
    DELETE FROM wp_posts WHERE post_type = "revision";
  4. Finally, phpMyAdmin will show you how many revision articles have been deleted:
    deleted
  5. If error occurs, you should substitute wp_ to the table prefix of your WordPress

Tags:

Leave a Reply

You must be logged in to post a comment.