brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: AUTOSAVE_INTERVAL in wp-config.php changes how often WordPress autosaves

WordPress
~/tips/tip-wordpress-autosave-interval

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

Sets the number of seconds between editor autosaves in WordPress.

While you write, WordPress saves an autosave of your post every 60 seconds. You can change that with one constant in wp-config.php.

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

That is the WordPress docs’ own example: an autosave every three minutes. The value is in seconds and the default is 60.

Which way should you go? The docs give both directions: raise it for longer gaps between autosaves, or lower it so you are less likely to lose changes. On a slow shared host where every autosave is a noticeable request, a longer interval makes the editor feel lighter. When you write long posts in the browser and your connection drops now and then, a shorter one is safer.

Put the line above the comment that says to stop editing, like every other constant in that file.

Caveats. This only changes the timing of autosaves; if your goal is a smaller database, the number of stored revisions is the setting to look at. And set it to something reasonable. Very short intervals mean many requests to your server for every open editor tab.

Further reading: WordPress: editing wp-config.php, On this site: limit post revisions in wp-config.php

More WordPress tips wp user application-password create anna backup-script --porcelain define( 'MEDIA_TRASH', true ); wp cli check-update wp theme delete --all wp media image-size All WordPress tips (85) All topics

Link