Yogesh Chauhan's Blog

How to update or disable WordPress Post Revisions?

in WordPress on December 30, 2021

Similar Posts:

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 );


Most Read

#1 How to add Read More Read Less Button using JavaScript? #2 How to check if radio button is checked or not using JavaScript? #3 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
A Quick Comparison of JOIN and Subquery in SQLSQL/MySQLHow to set up the local environment and workspace for Angular development?AngularColleague UI Basics: The Context AreaColleagueQuick Introduction to 11 Array Iteration Methods in JavaScriptJavaScriptIntroduction to components and templates Part 1: Component MetadataAngularHow to add a Bar Chart in Angular App?AngularHow to remove N/A from Radio Button list in Drupal?DrupalPostgreSQL transactions using the BEGIN, COMMIT, and ROLLBACK statements.PostgresHow to add Local State to a Class in React?ReactWordPress: How to add a Search Icon in Menus with toggle effect using jQuery?jQueryHow to Use password_hash and password_verify to Secure Your User’s Data (Especially Passwords)?PHPHow to install Gulp with WordPress?WordPress