A Post is saved twice or more during add_action(save_post)
One of the two IDs might be a post revision. To prevent this behaviour, I always have this checks in my save_postdata function: // Autosave, do nothing if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) return; // AJAX? Not used here if ( defined( ‘DOING_AJAX’ ) && DOING_AJAX ) return; // Check user permissions if … Read more