How to disable Post Revisions in WordPress
WordPress How To

How to disable Post Revisions in WordPress

Mishel Shaji
Mishel Shaji

If you are a WordPress blogger, you might have already noticed that WordPress offers a great feature called Post Revisions. In fact, Post revision is the periodic backups of your posts which are saved each time when you click the Save Draft or Update Button.

Each time a new Post Revision is saved, a new row is created in the posts table. So as the number of post revision increases, the database size also increases. This may make taking backups of the database difficult or users with limited database space may have to sacrifice their older posts to save new posts.

How to disable post revisions

You can disable or set a limit for the number of post revision manually or with the help of plugins.

Disabling Post Revisions manually

  • Go to the root directory of the WordPress installation.
  • Open wp-config.php and add the following code at the beginning:

define('WP_POST_REVISIONS', false);

  • Save and exit.

Limiting the number of Post Revisions (if you want to keep some revisions of your posts)

  • Go to the root directory of the WordPress installation.
  • Open wp-config.php and add the following code:
define('WP_POST_REVISIONS', 2);
//this will save only 2 post revision
//you can replace 2 with any number you wish
  • Save and exit.

Disable Post Revision using plugins

If you cannot access the wp-admin.php file or you don't like to code, these plugins are there to help.

Cleaning old Post Revisions

To clean old Revision from the database, you can use plugins such as WP Sweep. This plugin offers many methods to reduce database size. Although you can delete post revisions manually. But using plugins is a good choice.

WP-Sweep
WP-Sweep allows you to clean up unused, orphaned and duplicated data in your WordPress. It also optimizes your database tables.