If you want to rename countries in your WooCommerce store to better suit your business needs or enhance the customer experience, you’re in the right place. Whether you’re looking to shorten country names, use local terms, or simply make the store more user-friendly, WooCommerce provides an easy way to make these changes. In this guide, we’ll walk you through the process of renaming country names in WooCommerce and introduce a few plugins for advanced customization.
Why Rename Countries in WooCommerce?
Renaming countries in WooCommerce can greatly enhance your store’s localization, customer experience, and operational efficiency. While WooCommerce uses standard country names, there are several reasons why you might want to customize these names, particularly in areas like billing, shipping, and taxes.
Here are some key reasons why renaming countries can benefit your WooCommerce store:
- Simplifying Long Country Names
Long country names like “United States of America” can be shortened to a more user-friendly and concise version like “USA.” This makes it easier for customers to quickly identify their country, improving the overall user experience during checkout and other forms. - Using Local or Preferred Names
In some cases, the internationally recognized country names may not align with local preferences. For instance, instead of “Germany,” you could use “Deutschland” for your German-speaking audience. This can help make your store feel more familiar and culturally relevant, showing that you cater to your customers’ local needs. - Improving Customer Experience
Renaming countries can also improve the customer experience by offering terms that are more familiar or easier to understand. For example, some customers may prefer using “UK” instead of “United Kingdom” or “USA” instead of “United States of America.” Making these small tweaks can improve the checkout process and ensure your customers feel comfortable navigating your site. - Simplifying Billing and Tax Calculations
In WooCommerce, country names play a significant role in setting up billing addresses and calculating taxes. By renaming countries, you can align your tax settings with your local audience’s expectations or simplify your store’s setup process. For example, shortening “Republic of Korea” to “South Korea” can make the tax settings clearer for customers in that region, ensuring they don’t face confusion while filling out forms.
Step-by-Step Guide to Renaming Country In WooCommerce
Understanding Country Codes in WooCommerce
Country codes play a crucial role in WooCommerce by ensuring the accurate processing of shipping, billing, and customer details. These codes adhere to the ISO 3166-1 alpha-2 standard, which assigns each country a unique two-letter identifier (e.g., “US” for the United States and “CA” for Canada).
When customers provide their address, WooCommerce relies on these country codes to determine the correct country, which in turn allows the system to apply the appropriate shipping fees, taxes, and regional content. This helps to create a more personalized and precise experience for customers based on their location.
For a comprehensive list of ISO country codes, you can refer to a trusted online resource on ISO 3166 country codes. Also, for more updates about how to sell your WooCommerce store theme and design, you can visit Design Flea’s web designers section, where you can sell all your store assets on platforms like Envato.
Important Note Before Step By Step Process
Before we get started, it’s important to understand that modifying the functions.php file can directly affect your theme’s functionality. Be sure to back up your site before proceeding to avoid any accidental changes that could impact your store. The functions.php file is a powerful tool that allows you to add custom code to your site, so it’s crucial to handle it carefully. Once you’re ready, follow the steps below to easily access and modify this file.
Step 1: Open the functions.php File
The first step is to locate and open the functions.php file of your active theme. This is where you’ll add the code snippet to rename country codes in WooCommerce.
Log into your WordPress Dashboard.

After logging into your WordPress admin, go to the sidebar and click on Appearance > Theme Editor. This will bring up the theme files for your active WordPress theme.
Locate the functions.php file.

On the right-hand side of the Theme Editor window, you’ll see a list of template files under Theme Files. Scroll through this list and locate functions.php, which is typically labeled as Theme Functions.
Open the functions.php file.

Click on functions.php to open it in the Theme Editor. This file contains the custom functions for your WordPress theme, where you will add the code snippet.
Step 2: Add the Code Snippet
Now that you’ve opened the functions.php file, it’s time to add the code that will rename a country code in WooCommerce. Follow these steps:
Copy the Code Snippet Below:
php
CopyEdit
/** * Rename a country */ add_filter( 'woocommerce_countries', 'rename_ireland' ); function rename_ireland( $countries ) { $countries['IE'] = 'Ireland'; // Change 'Ireland' to the name you want return $countries; }
Paste the Code:

Scroll down to the bottom of the functions.php file and paste the above code snippet just before the closing PHP tag (if there is one). This ensures that the snippet is added at the end of the file.
Step 3: Explanation of the Code
If you’re not familiar with PHP or WordPress, the code may look a bit complex at first. However, let’s break it down step by step so you can understand how it works.
PHP Comments

The first lines are comments. These are not executed but simply provide information to the person reading the code. In this case, they explain that this block of code is used to rename a country.
Binding a Custom Function to the WooCommerce Filter :

The line uses the add_filter() function to bind a new custom function, rename_ireland(), to the woocommerce_countries filter hook. This hook is responsible for altering country data in WooCommerce.
Renaming the Country :

In the custom function rename_ireland(), the country code IE (which represents Ireland in ISO 3166-1) is renamed. The countries[‘IE’] = ‘Ireland’; line is where the country name is modified. You can change the country code and name to anything you’d like, such as renaming the United States or another country in your store.
Step 4: Customizing the Code for Other Countries
To rename a country other than Ireland, you’ll need to make a few small changes to the code:
- Change the Country Code: The country code is a two-letter abbreviation used by WooCommerce to identify the country. For example, the country code for the United States is US, for Canada, it’s CA, and for the UK, it’s GB. You can replace ‘IE’ with the code of any other country you want to rename.
- Rename the Country: The name after the equal sign is what will display on your website. For instance, if you’re renaming “United States” to “USA,” you would change this line to:
php
CopyEdit
$countries[‘US’] = ‘USA’;
- Custom Function Name:
It’s always a good idea to give the custom function a name that helps you remember its purpose. For example, if you’re renaming the United States, you could name the function rename_us or rename_united_states.
Here’s how the code would look for renaming the United States:
php
CopyEdit
/** * Rename a country */ add_filter( ‘woocommerce_countries’, ‘rename_us’ ); function rename_us( $countries ) { $countries[‘US’] = ‘USA’; // Renaming US to USA return $countries; }
Be sure to change the function name in both the add_filter line and the function definition, or it won’t work correctly.
Step 5: Save and Close the functions.php File
Once you’ve added the code snippet and made any necessary modifications, it’s time to save your changes:
- Save the File: After you’ve added the code, scroll down and click the Update File button to save your changes.
- Close the File: After saving the file, you can exit the Theme Editor. Your changes will be live on your website!
Step 6: Verify the Changes
Once the changes are saved, it’s important to verify that the country name has been updated correctly on your WooCommerce store:
- Visit the Checkout Page:
Go to your store’s checkout page and see if the country name has changed in the country selection dropdown. - Test the Functionality:
Add a product to the cart and proceed to the checkout process. Ensure that the renamed country appears in the list and that it is functioning as expected (i.e., shipping rates and taxes should still apply correctly).
After Renaming Countries in WooCommerce: Enhance Your Store with Aelia Plugins
Once you’ve renamed countries in your WooCommerce store to better align with your customers’ preferences, you can further enhance your store’s functionality by using advanced plugins like Aelia Tax Display by Country for WooCommerce and Aelia Prices by Country for WooCommerce.
These plugins offer additional customization options to help you manage taxes, prices, and product availability based on the country of the visitor or customer, making your WooCommerce store even more tailored to your global audience.
Aelia Tax Display by Country for WooCommerce
This plugin automatically adjusts the display of prices based on the visitor’s country, making it easier for customers to understand how taxes will be applied. Depending on the location of the visitor, the plugin will show the price either with or without tax.
For example:
- If a customer from the UK visits your store, they’ll see the price including VAT (Value Added Tax).
- A customer from outside the EU may see the price excluding VAT, making it clear whether taxes are included or not.
The plugin also gives you the ability to keep prices fixed, no matter the applicable VAT rate. This is particularly useful if you want to ensure your pricing remains consistent across different regions, regardless of varying tax laws.
Example:
- Price: £49.00 (ex. VAT)
- Displayed as: £59.00 (inc. VAT for UK customers)
This ensures customers always see the correct pricing information for their location, which is essential for a transparent and seamless shopping experience.