Just My Random Stuff Just some hopefully useful, yet random posts from my own experiences, that nobody ever told me about before.

20Jun/100

Disable Autosave in WordPress when adding and editing posts – the right way

So, I have been following everyone's recommendations when trying to disable the autosave feature in WordPress and yet it would still load the functionality when adding or editing posts.  So, I took the time and figured out why the fixes didn't work, and now, here is the way to truly disable the autosave functionality in WordPress.  As always, this works for me, if it does not work for you, please don't email me, yell at me, call me names, or whatever else.  And, this may or may not be the best way to do it, but like I said, it works for me.

It is pretty easy to disable the autosave.  If you have a plugin you are writing, you can include it in the plugin, or if not, you can add it to your themes functions.php file.

function myDisableAutosave() {
    wp_deregister_script('autosave');
}
add_action('admin_footer','myDisableAutosave');