An Introduction to wp-config file in WordPress
How to modify AutoSave Interval using code in WordPress?
WordPress saves copies of post and page edits as you make them.
In fact, there is a whole version history available for each post and page which makes it really easier to revert back to the previous saved version.
How to Disable Post Revisions?
This is how you can disable post revisions in WordPress:
Add this code in wp-config.php file.
define( 'WP_POST_REVISIONS', false );
By default, WP_POST_REVISIONS value is set to true which enables post revisions.
How to specify the Number of Post Revisions?
If you think WordPress is creating way more revisions than you’d want it to create then you might want to specify a lower number for saved post revisions. It helps with your database since there will be a fewer revisions and less data to store.
We can use the same code above but rather than false, we can specify the number of revisions.
define( 'WP_POST_REVISIONS', 2 );
disable pages posts update WP_POST_REVISIONS wp-config