wp_insert_post_data filter to set category

I think that the best way to set the default category is in the wp-admin: Settings > Writings > Default post Category However, I think you’re looking for setting more than one category by default.

If you look the documentation of wp_insert_post_data, there isn’t any key such as post_category.

Perhaps, you should use publish_post

Runs when a post is published, or if it is edited and its status is “published”. Action function arguments: post ID.

There, you should use wp_set_post_categories

So, the code would be something similar to this:

function set_category_by_default( $post_ID ) {
    wp_set_post_categories( $post_ID, array(123, 124) ) ;
}
add_action( 'publish_post', 'set_category_by_default', 5, 1 );