How to disable auto-save and disable post revisions in WordPress

888u

Last update at :2024-04-07,Edit by888u

When writing an article in the WordPress background, it will always be automatically saved, and every time you click save or publish, an article version will be automatically generated and recorded in the database.

The biggest benefit of the auto-save function is that it can effectively prevent the loss of article content. Especially when writing long articles, you don’t have to worry about losing all your hard work by automatically saving it from time to time.

The article revision function also has great benefits. It can save the version every time the article is updated, which is helpful for reviewing previous versions or retrieving part of the content that was deleted due to manual errors. But at the same time, there is also a problem of occupying additional database capacity. Many webmasters do not like this function because the database capacity is limited.


How to disable automatic saving and disable post revisions in WordPress

Modify the wp-config.php file in the WordPress root directory, find the line $table_prefix, and add the following code below it:

// WordPress disables auto-save
define('AUTOSAVE_INTERVAL', false);

// WordPress disables post revisions
define('WP_POST_REVISIONS', false);

or

You can freely configure the auto-save interval (in seconds) and the maximum number of article revisions using the following code:

// WordPress sets the article auto-save interval to 120 seconds
define('AUTOSAVE_INTERVAL', 120);

// WordPress settings allow up to 3 article revisions
define('WP_POST_REVISIONS', 3);

Recommended site search: free space, server rental, asp free space application, free asp.net space, cheap virtual host, US server defense, free domain name application, cloud server rental platform, Korean cn2 server, Hong Kong host,

How to disable auto-save and disable post revisions in WordPress

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码