wp wc php change customer shipping country for all users

  1. Create a child theme in WordPress.
  2. Create a functions.php file in the child theme.
  3. Add the following code to the functions.php file to change the customer's shipping country:
add_filter( 'default_checkout_country', 'change_default_checkout_country' );
function change_default_checkout_country() {
    return 'US'; // Change this to the desired country code
}
  1. Save the functions.php file and activate the child theme in WordPress.