Today we will talk about How to disable autosave in WordPress. When we edit any post or create a new post in WordPress, all the changes we do, everything we write on the white canvas, adding image, adding video, formatting content etc. are automatically saved after a short period of time, It can be every 30 or 60 seconds.
The post changes are saved in the form of revisions, in order of increasing time in the database. Well a good thing is that we can disable WordPress autosave feature.
Why to disable autosave in WordPress ?
In most cases, it is ok to keep autosave enabled. But, if you are using little cheaper hosting plans or want to improve performance or running out of resources then you should go and disabling WordPress autosave feature. If you are facing issues related to hosting then also you can disable WordPress autosave.
How to disable autosave in WordPress ?
There are many ways to disable autosave feature of WordPress, We will be talking about few of them. We can disable autosave in WordPress by using WordPress plugins like Gutenberg autosave, LAPDI Disable Autosave, disable autosave, Adding a code to website’s functions.php and disable autosave by editing wp-config.php (WP configuration) file. Let’s go to the process one by one:
Disable autosave in WordPress by editing wp-config.php file
To disable WordPress autosave feature using this method in your website, you need to copy and paste the below code snippet to your WordPress configuration file.
define('AUTOSAVE_INTERVAL', 86400);
To update the the WordPress configuration file, You have to first login to your cPanel, look for file manager and navigate to the root directory of the website. In the root directory you will find WP configuration file, the name of file will be wp-config.php. Now you can use the online code editor which is inbuilt within the file manager to edit the file and added the above code snippet to your wp-config.php file.
Technically this process does not disable autosave feature in WordPress, It just adjust increases the autosave time interval to a day, therefore post which you are doing will be saved after a day or 24 hours. This is how editing wp-config file method works to disable WordPress autosave feature.
Disable WordPress autosave feature by adding code in functions.php file
This method to disable autosave in WordPress is one of the easiest method. To disable autosave feature in WordPress using this method
- Login to WordPress website dashboard.
- Click on Appearance, A submenu will appear.
- Now click on Theme editor. An editor box with code will appear.
- You will see a file named functions.php at the right hand side, click on that to load it in the editor box
- Paste the below code in that file
add_action( 'admin_init', 'disable_autosave' );
function disable_autosave() {
wp_deregister_script( 'autosave' );
}
- Click on Update file button to disable WordPress autosave feature. This button will appear below the code editor box.
Note: Don’t forget to click on Update file button else changes won’t happen.
To re-enable autosave in WordPress just remove the code you added and click on the Update file button. It will start autosaving posts and pages automatically.
Disable autosave in WordPress by using a WordPress plugin
You have many plugins which can be used to disable autosave feature of WordPress. One of such plugin is Disable Gutenberg Autosave which we will use. We have many more such plugins like LAPDI Disable Autosave, disable autosave, etc. To install this plugin either you have to download it from here and upload to plugin section under your website dashboard or go to plugin section and search for Disable Gutenberg Autosave. Install it and activate it.
Once Disable Gutenberg Autosave plugin is activated, it will automatically disable autosave feature of WordPress. This plugin not only disables autosave, but it has some more features which can be utilized as per need. Like we can set a time interval to avoid completely disabling autosave feature of WordPress.
To access this feature we have to open post editor of WordPress, At the top right hand side we have to click on three vertical dots, then there you will see an option which says Disable Gutenberg Autosave, click on that. Now you will see an option to set time, the option will contains various time intervals. You can see values like 10, 30 second, one minute, 5 minute, 10 minute 30 minute or disable it. Once you select option click on update the post and this setting will be saved and it will be applied to all the force.
This is all about “How to disable autosave in WordPress quickly”, If you have any query please comment below. For more tips and tricks related to WordPress visits this link.