# Limit WordPress Post Revisions
define('WP_POST_REVISIONS', 5); // Here 5 post revisions are allowed.
If you want to limit the number of Post Revisions in WordPress, add this code to your config.php file in the root directory (the public_html folder).
By default, WordPress saves unlimited number of post revisions. It can increase database size and you have to manually clear old revisions using some optimizing plugins.
However, it is always better to limit the revisions WordPress saves instead of disabling. Incase data gets erased, you may not have any data left to be restored. WordPress sometimes goes out of control OR your hosting provider can return Error 522.
If you don’t have access to your hosting control panel, use File Manager Plugin.
Note: Existing post revision’s will not be affected. As an example, if you have an article with already 10 revisions, this code will not decrease them to 5. This code affects only new posts and pages.