Skip to content

Instantly share code, notes, and snippets.

@wpgaurav
Created September 21, 2022 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpgaurav/04b74910f33b96cc8abf5a8447e0750f to your computer and use it in GitHub Desktop.
Save wpgaurav/04b74910f33b96cc8abf5a8447e0750f to your computer and use it in GitHub Desktop.
Limit the maximum number of post revisions stored on Database
<?php
if(!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS',10);
?>
@wpgaurav
Copy link
Author

This reduces the load on your web-host by changing infinite post revision limits into a finite number. For example, if you want to save no more than 10 post revisions of posts/pages in your dashboard, place the above code.

@wpgaurav
Copy link
Author

This works only if you have not already set post revisions’ limit in your WordPress installation’s wp-config.php file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment