Hierarchical Custom Post Types – Show only parent on tax archive?

I have a cpt of Accommodation

Taxonomy of Region

Regions are then added like USA, Canada etc

Then for the posts:

I create a post for a whatever Resort and a child posts of whatever Hotel in that resort ( Hierarchical ) and assign it to a tax term like USA

All good and working 100% perfect

Question: when I go and view say USA

I see all the posts, both parent and child

How can I only show the parent post and not the children on these taxonomy archives?

Figured a simple pre_get_posts would do the trick, but tried like 20 variations with no luck

Suggestions appreciated

Solutions Collecting From Web of "Hierarchical Custom Post Types – Show only parent on tax archive?"

Figured a simple pre_get_posts would do the trick,

It will, you just need to query posts that have a parent of 0.

Assuming your taxonomy slug/name is literally just region:

function wpse_286405_parents_only( $query ) {
    if ( ! is_admin() && $query->is_tax( 'region' ) ) {
        $query->set( 'post_parent', 0 );
    }
}
add_action( 'pre_get_posts', 'wpse_286405_parents_only' );