Update post meta within save_post action
The problem is probably that the $post_id parameter passed to via the save_post_$post_type hook is not the same $post_id as the original post – it’s the $post_id of the temporary post that’s created when you edit a post. To confirm this: add_filter( ‘pre_post_update’, ‘wpse_pre_post_update’, 10, 3 ); add_filter( ‘save_post’, ‘wpse_save_post’, 10, 1 ); function wpse_pre_post_update( …