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 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #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
:in-range and :out-of-range selector in CSSCSSCanvas Drawing in HTML5HTMLHow to create a Horizontal Scroll on button click using JavaScript?JavaScriptSQL Left JoinSQL/MySQLWordPress: How to display slider repeater fields in ACF?WordPressSolution to “NullInjectorError: No provider for module” in Angular 9AngularWhat are CSS Specificity Rules and how does browser apply them?CSSCREATE TABLE Examples in PostgreSQLPostgresIs Software Really Eating The World? I don’t think soMiscellaneousHow does AdSense calculate page loading time?JavaScriptALTER DATABASE in PostgreSQLPostgres4 ways to create Date Objects in JavaScriptJavaScript