Add a New Country to WooCommerce Countries List

The following snippet is taken from WooCommerce documentation and does exactly what you think. Add this snippet to your functions.php file to add a new country to the WooCommerce countries list:

function woo_add_my_country( $country ) {
   $country["AE-DU"] = 'Dubai';
   return $country;
}
add_filter( 'woocommerce_countries', 'woo_add_my_country', 10, 1 );
Discussion
[  0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!