After upgrading to a new version of WordPress, the Gutenberg editor was introduced. The code you previously used to disable auto save and revisions may have become ineffective. This article shares the
Method to Disable Revisions and Auto Save。
What are WordPress Revisions and Auto Save

If you are using the Gutenberg editor, you will notice an additional revision appears after clicking the Save Draft button once. If you are using the older Classic Editor, you will also find that it auto-saves every minute, creating another revision. The revision looks like the image below.

In some cases, this revision and auto-save feature is useful. However, in most situations, auto-save and revisions are unnecessary. Over time, your database will retain a lot of revision data, causing database bloat and thereby
affecting WordPress performance speed. Therefore, when the revision and auto-save features are not needed, we can disable WordPress Post Revisions and Auto Save.
Official Recommended Method to Disable Revisions and Auto Save
By default, WordPress has a WP_POST_REVISIONS function for post versions. WP_POST_REVISIONS is used to control whether revisions are displayed. We can set the revision function by inserting relevant code into the WordPress configuration file wp-config.php.
//禁用WordPress修订版本
define( 'WP_POST_REVISIONS', false );
WP_POST_REVISIONS has three default values: true (default), -1: means store every revision. false, 0: do not store revisions (except for one auto-save version per post). A value greater than 0: sets the number of revisions to save, previous versions will be deleted. So we also need to disable auto-save. WordPress defaults to auto-saving periodically (though Naiba tested in the new Gutenberg editor and found revisions only appear after manual save, no auto-save was found; auto-save was found in the Classic Editor).
Method to Disable Auto SaveInsert this string of code into the wp-config.php file to set the auto-save interval.
define( 'AUTOSAVE_INTERVAL', 160 ); // 修改自动保存间隔时间为160秒
We can modify the value 160 to set the auto-save interval. Setting it to 86400 means auto-saving the article once a day. Presumably, by that time, your article has already been published, which is equivalent to disabling WordPress's auto-save function. Insert the above code above /* That's all, stop editing! Happy publishing. */ in the wp-config.php file to take effect. The above method is from
official documentation。
Method to Clean Up Revision and Auto Save Data
If your WordPress has already saved many revisions and auto-save data, you can use
WP-Optimizeto clean up and optimize your database. If you are using
WP Rocketthis caching Plugin, you can also clean up redundant database files in the settings.
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.