How to manage Autosave on WordPress

Marc Wag­ner

Febru­ary 21, 2022

1 min read|

Word­Press saves your posts / pages auto­ma­ti­cal­ly in cer­tain time inter­vals. You are sure­ly used to some­thing simi­lar from Word or Open­Of­fice. This func­tion is used to ensu­re that in case of a con­nec­tion loss or a crash of your com­pu­ter, not all data is lost.

Customize Autosave in WordPress #

You can set the time inter­val in which the back­ups are per­for­med. To do this, open the wp-config.php of your Word­Press ins­tance with an edi­tor (e.g. Note­pad++) and add the fol­lo­wing line:

define('AUTOSAVE_INTERVAL', 300);

The 300 stands for the seconds that must elap­se in order to per­form a sto­rage. In our case this would be 5 minu­tes. You can enter any value here.

Disable Autosave in WordPress #

The auto­ma­tic saving can be deac­ti­va­ted in Word­Press by remo­ving the cor­re­spon­ding script. To do this, open the functions.php which is loca­ted in the direc­to­ry of your the­me. Add the fol­lo­wing code snip­pet to the file:

add_action( 'admin_init', 'disable_autosave' );

function disable_autosave() {
     wp_deregister_script( 'autosave' );
}

Now the auto­ma­tic saving should be pre­ven­ted.

Fazit #

Word­Press is very fle­xi­ble and allows you to defi­ne just about all set­tings accor­ding to your own wis­hes. As a Word­Press agen­cy, we deal with the various set­ting opti­ons on a dai­ly basis. If you have any ques­ti­ons, plea­se feel free to cont­act us.

88e86fcb816eff22bc917094df2862d8dd5c0e978b333e6dd5f36f808990c261 96

Arti­kel von:

Marc Wag­ner

Hi Marc here. I’m the foun­der of Forge12 Inter­ac­ti­ve and have been pas­sio­na­te about buil­ding web­sites, online stores, appli­ca­ti­ons and SaaS solu­ti­ons for busi­nesses for over 20 years. Befo­re foun­ding the com­pa­ny, I alre­a­dy work­ed in publicly lis­ted com­pa­nies and acqui­red all kinds of know­ledge. Now I want to pass this know­ledge on to my cus­to­mers.

Hast du eine Fra­ge? Hin­ter­lass bit­te einen Kom­men­tar