How to disable Revisions and Autosave on WordPress? Let’s look into the details here. At Bobcares, with our WordPress Support Service , we can handle your issues.
Overview
Disabling Revisions and Autosave on WordPress
Records of every stored draft and published article data are kept in WordPress(WP) revisions. WP saves a complete image of a post or page data in the database each time we save the draft, whether we choose to save it manually or automatically.
However, WP saves each post change in the database by default using post revisions. These post changes could be a pain if the server and database size are important to user. We can’t just turn off a post type’s post revision feature from the settings page if we don’t want it.
Steps Needed
To turn off revisions and autosave in WP, we’ll need to edit the wp-config.php file and optionally a plugin or theme’s functions file. Here are the steps:
1. Open the wp-config.php file, which will be in the root directory of the WP setup.
2. Add the following line to turn off revisions entirely:
define('WP_POST_REVISIONS', false);
3. Also, we can limit the number of changes to keep by choosing a number instead of false:
define('WP_POST_REVISIONS', 3);
Now, to turn off Autosave:
4. Open the wp-config.php file.
5. Add the following line to adjust the autosave interval. Setting it to a high value effectively disables often autosaves:
define('AUTOSAVE_INTERVAL', 86400); // Autosave every 24 hours
6. If we prefer using a plugin or theme’s functions file, we can add this snippet to the functions.php file of the theme or create a site-specific plugin:
function disable_autosave() { wp_deregister_script('autosave'); } add_action('wp_print_scripts', 'disable_autosave');
7. After making these changes, save the wp-config.php file and upload it back to the server if we edited it locally.
8. For changes to the functions.php file, save the file and ensure the theme is active.
[Need to know more? Get in touch with us if you have any further inquiries.]
Conclusion
Disabling revisions and autosave can help reduce database size and improve performance. This article explains the steps from our Experts to disable these features on WordPress.
var google_conversion_label = "owonCMyG5nEQ0aD71QM";
0 Comments