Change the Autosave Interval
Autosaves drafts every two minutes instead of every minute, in both the block editor and the classic editor.
Opens WPIDE on
Code
$wpide_autosave_seconds = 120;
if ( ! defined( 'AUTOSAVE_INTERVAL' ) ) {
define( 'AUTOSAVE_INTERVAL', $wpide_autosave_seconds );
}
add_filter( 'block_editor_settings_all', function ( $settings ) use ( $wpide_autosave_seconds ) {
$settings['autosaveInterval'] = $wpide_autosave_seconds;
return $settings;
} );
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.