$update is always true in save_post

So appreciate this is a bit late but I was having the exact same issue, the $update parameter is almost completely useless if you want to check whether it is a new post or not.

The way I got around this was to compare the $post->post_date with $post->post_modified. Full code snippet below.

add_action( 'save_post', 'save_post_callback', 10, 3 );

function save_post_callback($post_id, $post, $update) {
    $is_new = $post->post_date === $post->post_modified;
    if ( $is_new ) {
        // first publish
    } else {
        // an update
    }
}

Hope that helps anybody else finding this.

Leave a Comment