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 … Read more