It's worth noting that the most current method for achieving this will likely always be viewable in the Woocommerce documentation, here.
It's also worth noting it may be undesirable to remove the default country for existing (logged-in) customers. At least on sites that allow customers to have a customer account. For those customers the address fields will be automatically filled out for them, and if you remove the default country for all uses, then their address will be filled out, except that the country will be missing.
With that in mind, as of January 2022, I would suggest this code as a useful way to achieve what the OP requested:
add_filter( 'default_checkout_billing_country', 'change_default_checkout_country', 10, 1 );
function change_default_checkout_country( $country ) {
// If the user already exists, don't override country
if ( WC()->customer->get_is_paying_customer() ) {
return $country;
}
return null;
}
This is a slight variation of what's conveyed in the WC documentation, which was addressing how to change what the default country is set to. In this case we're setting it to Null
.