How to Disable or Limit Post Revisions in WordPress

WordPress creates revisions to posts and pages which are automatically saved it the database. Any small change made to a post will be saved as a revision, hence there will be many revisions for each post. All the old post revisions are never deleted, hence increases the load on database. It is necessary to disable or limit post revisions, simply follow this tutorial to do so.


Read This : How to add 3 column footer to WordPress theme

Disable Post Revisions in WordPress

Open you WordPress installation folder, edit wp-config.php file and add the below code to it and save it.

// Completely disable post revisions
define('WP_POST_REVISIONS', false);

Functionality of Code:

  • This will completely disable post revisions in WordPress.
  • It is not recommended to disable post revisions, so try to limit them using code below.

Also Read : How to display related posts in Genesis Theme without a Plugin


Limit post Revisions in WordPress

Add below code to wp-config.php file and save it.

// Limit post revisions in WordPress
define('WP_POST_REVISIONS', 2);

Functionality of Code:

  • This will limit post revisions to certain value.
  • In this case, the value is '2', means two post revisions and one auto-save.
  • Change the value to any positive integer, it works.

Hope you like this article on how to disable or limit post revisions in WordPress. If you got any query regarding this, please do post a comment.


Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>