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 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

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
How to compress images with gulp in WordPress?WordPressSteps to Install Microsoft SQL Server on a MacOSSQL/MySQLWordPress: How to loop through a repeater field in ACF?WordPressCan We Use For Loop to Loop Through Associative Arrays in PHP?PHPHow to create and store JSON objects in localStorage using JavaScript?JavaScriptHow to add Google Static Map using ACF map field?WordPressHow to show confirmation alerts with OK and cancel buttons using Swift 5?SwiftHow to create a simple digital clock using JavaScript?JavaScriptHow to embed YouTube or other video links in WordPress?WordPressWhen you don’t want to @forward every member in SCSS (Sass)SCSSHow to delete a local and a remote Git branches?MiscellaneousArbitrary Arguments in SCSS functionsSCSS