Hook for post permalink update
You need to exactly use wp_insert_post_data. This contains array of post data what will be store into database after WordPress has done all of the validation/sanitization. add_filter(‘wp_insert_post_data’, ‘wpse_wp_insert_post_data’, 10, 2); function wpse_wp_insert_post_data($data, $post_attr) { // you get the post_name using $data[‘post_name’]; // post id will not be present for the first insert // but you … Read more