I have went into an issue with Wordpress getting rid of custom fields when autosaving with a a reasonably simple workaround You can easily add this to the start of the save purpose of your wordpress plugin...

function saveCustomfield($post){

    // Prevent loss of data on AutoSave
    if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ):
        return $post_id;

    // do something....


However, should one attempt to "restore" from an autosave, the custom fields disappear again.

So far as I will tell, wordpress always produces a brand new revision from the publish at autosave even when I personally use the above mentioned workaround, by clicking "restore", the revision overwrites the present version from the publish. However, the custom fields within the auto save version are empty, therefore the data vanishes.

A customer continues to be making heavy utilisation of the restore feature, therefore it is be a necessity to obtain wordpress to auto-save custom fields. However, all of the threads I have found relevant for this problem make use of the above fix.

Does anybody have tips about makinf auto-save to really save custom-fields?