WordPress Tutorial: Disable Autosave

WordPress does a good job at saving headaches for editors by including helpful functions such as automatically saving posts when the post edit screen is open.

The only problem with this particular feature is that it creates an overhead on the server that can impact performance on the front-end, customer facing website. This problem becomes even more pronounced when you have multiple editors writing posts at the same time. The automatically saved posts build up into a large amount of database inserts that can form a bottleneck on the server.

Using the following code it is possible to remove the autosave functionality and help speed things up. Just remember to tell your editors to save their work locally before using WordPress to publish the post.

Add the following snippet to your function.php file:


add_action( 'wp_print_scripts', 'disable_autosave' );
function disable_autosave() {