Yogesh Chauhan's Blog

How to modify AutoSave Interval using code in WordPress?

in WordPress on December 30, 2021

You might like these posts:

How to invalidate all existing cookies using Security Keys in WordPress?

WordPress: How to create a folder if it doesn’t already exist?

How get_template_part helps write reusable code in WordPress?

If you pay attention while writing your blog post, you must have noticed that WordPress is saving the posts as you edit them – just like Google or MicroSoft Office products.

While Google and Microsoft have their own technics to check for the edits and save them, WordPress uses familiar AJAX to auto save the posts into separate revisions.

The default WordPress AutoSave Interval is 60 seconds.

If you think WordPress is creating way more revisions than you’d want it to create then you might want to change the intervals and delay the auto save to create a fewer revisions. It helps with your database as well since there will be a fewer revisions and less data to store.

Similarly if you want WordPress to constantly save changes, you could do that too so that you’ll never lose any changes made to your post.

This is how you can modify AutoSave Interval:


define( 'AUTOSAVE_INTERVAL', 200 ); // Seconds

You need to add the code above into wp-config.php file.


Most Read

#1 How to add Read More Read Less Button using JavaScript? #2 How to check if radio button is checked or not using JavaScript? #3 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 How to uninstall Cocoapods from the Mac OS? #6 PHP Login System using PDO Part 1: Create User Registration Page

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
PHP Variables ScopePHPHow to install Gulp with WordPress?WordPressColumn and Table Alias in PostgresPostgresHow to change your WordPress database prefix?WordPressDoes :is() pseudo selector hint at CSS preprocessing in the future?CSSHow to use $IF operator in Envision Basic?Envision Basic