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
List of social media icon logo color codes in HEXMiscellaneousHow to remove special characters (dash, asterisk etc) from any string in PHP?PHPRendering Elements in ReactReactLearn how to add Scroll Indicator using CSS and JavaScript?CSSHow to Remove PHP File Extensions From Your Website URLs?PHPHow to Sort (Shuffle) an Array in Random Order in JavaScript?JavaScriptHow to auto-resize textarea based on text input using JavaScript or jQuery?JavaScriptWhat is HTMLUnknownElement?HTMLHow to Clone Objects in PHP?MiscellaneousHow to get current timestamp in Swift 4 and 5?SwiftALTER DATABASE in PostgreSQLPostgresData Flows in ReactReact