Change autosave interval WordPress

WordPress by default automatically saves a draft every 60 seconds (1 minute). There are reasons why you might want to change this. You could decrease it so as not to ever lose anything. But we prefer to increase it so that your browser doesn’t “hang” as much, and this also results in fewer writes to the database.

function change_autosave_interval( $interval ) {
    return 120; // change interval to 120 seconds (2 minutes)
add_filter( 'wp_ autosave_interval', 'change_autosave_interval' );
Was this guide helpful?