Web Development

Disable WordPress Post Revisions

While adding the post or pages in wordpress, it will automatically save your posts/pages to make sure that your changes should not lost.

WordPress store this auto saved versions as a revisions in the post table. We can manage this autosave interval as well.

To know more about this post auto save interval, check out our atricle.

But what if you want limit the number of revisions per post or want to disable this post revisions facility.

Don’t worry, you don’t have to make any changes in wordpress code. You can manage this with wp-config.php file only.

Please find below code snippet for limit the number of revisions or disable the post revision facility.

Limit the Number of Revision:

[cc lang=”php”]
define(‘WP_POST_REVISIONS’, 3);
// This will store only 3 revisions of any posts.
[/cc]

Disable Post Revisions:

[cc lang=”php”]
define(‘WP_POST_REVISIONS’, false );
// This will disable wordpress post revision feature.
[/cc]

Note: If we do not set this value in wp-config.php file, then it is default set to TRUE.

Shares:

Leave a Reply

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