Avoid or limit revisions

When you edit a page or post the old version will automatically be saved. Every time you edit a page or post, the old version is saved. These old versions pollute the database unnecessary, especially when you never delete them. You can install a plugin to manage and/or delete the revisions and clean up your database. You can also set a limit to the number of saved revisions or avoid saving revisions completely with some code.

When you have no need to keep old versions at all, you can add the following code to wp-config.php.

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

When you do not want to entirely disable saving revisions, but want to restrict, for example, to the last five, add the following code to your wp-config.php.

// limit five post revisions
define('WP_POST_REVISIONS', 5);

Always backup wp-config.php before you make any changes to it!

0 0 vote
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x