WordPress revision system is pretty useful to keep track of our changes to a particular post. This feature enables us to revert back to the previous version. But did you know? just like any functionalities, it’s a double-edged sword. If you have thousands of blog posts and it has plenty of post revisions each, it can slow your website since it takes more time for WordPress to fetch posts from the database.
Some people, including me, prefer to limit the maximum post revisions or even disable WordPress revisions to achieve maximum performance for our WordPress blog. On this blog post, I would like to share how to limit or disable WordPress revision.
How to set maximum WordPress Post Revision?
As written on WordPress documentation, we can limit the post revision by adding ‘WP_POST_REVISIONS‘ flag to wp-config.php in your WordPress source. The wp-config.php file located in the root of our website. Don’t forget to add semicolon at the end of the flag. The flag looks like this:
define( 'WP_POST_REVISIONS', 3 );
On config above we limit the maximum post revisions to 3. If we want to completely disable this feature, we can set the flag like this:
define( 'WP_POST_REVISIONS', 0 );
Since this flag also accept boolean value, we also can set the value to false, like this:
define( 'WP_POST_REVISIONS', false );