How to Easily Rename Country Codes in WooCommerce
Have you ever wanted to change how country names appear in your WooCommerce store? Maybe you need a shorter country code or a different language for customer clarity. Fortunately, WooCommerce makes customizing country codes a straightforward process.
Explore our full range of WooCommerce plugins here
Step-By-Step Guide to Renaming Country Codes In WooCommerce
Understanding Country Codes
Country codes are essential for ensuring accurate shipping, billing, and overall customer experience in WooCommerce. They follow the ISO 3166-1 alpha-2 standard, which means each country has a unique two-letter code (e.g., “US” for the United States, “CA” for Canada).
Whenever a customer enters their address, WooCommerce uses these codes to match the appropriate country. This helps determine shipping rates, taxes, and even display region-specific information.
Locating the functions.php File:
Your theme’s functions.php file is where you can add small snippets of code to modify how WooCommerce works. Let’s find it:
Method 1: Via Your WordPress Dashboard
- Log in to your WordPress Dashboard.
- On the left-sidebar, go to Appearance -> Theme Editor.
- On the right, you’ll see a list of theme files. Look for functions.php (Theme Functions). Click on it to open.
Method 2: Via an FTP/File Manager
- Access your website’s files using an FTP client (like FileZilla) or your hosting provider’s file manager.
- Navigate to your theme’s root folder (often inside /wp-content/themes/your-theme-name/).
- Find and open the functions.php file.
IMPORTANT: Child Themes
Before making any changes, it’s strongly recommended to use a child theme. This prevents your customizations from being lost when you update your main theme.
Adding the Code Snippet
Let’s do the rename! Copy and paste the following code at the bottom of your functions.php file:
Plain text version of the above:
PHP
function rename_country_code( $countries ) {
// Rename "US" (United States) to "USA"
$countries['US'] = 'USA';
// Add more renaming cases if needed:
// $countries['XX'] = 'YY'; // Where 'XX' is the old code, 'YY' is the new code
return $countries;
}
add_filter( 'woocommerce_countries', 'rename_country_code' );
Understanding the code:
- The first line connects a new function (which we’ll define below) to WooCommerce’s list of countries.
- my_country_rename is the name of our function. Feel free to change it to something that describes your specific change.
- Inside the function, we change the ‘US’ country code to ‘United States’. This part is where you’ll make your edits.
Customizing for Your Needs
Make it your own:
- Replace ‘US’ with the two-letter code of the country you want to rename.
- Replace ‘United States’ with the new name you’d like to display on your store.
WooCommerce Country Code Rename FAQs
What is a country code?
Country codes are standardized two-letter abbreviations that represent countries and territories around the world (e.g., “GB” for Great Britain, “DE” for Germany). These codes, defined within the ISO 3166-1 alpha-2 standard, are a crucial part of online stores, ensuring they can process customer addresses accurately for shipping and billing.
How do I change the default country code in WooCommerce?
In WooCommerce, you can’t technically change the overall default country for your entire store. However, you have the flexibility to rename specific countries as needed. This lets you customize how they appear to your customers during checkout and within their account information.
What countries does WooCommerce support?
WooCommerce is designed to support virtually all countries across the globe. You can find a comprehensive list of ISO 3166-1 alpha-2 country codes to check if your required country is included. Keep in mind, the renaming process we’ve outlined works for any country supported by WooCommerce.
Additional Considerations – Potential Conflicts
While renaming country codes is usually straightforward, it’s good to be aware that custom code changes can sometimes lead to unexpected conflicts, especially in stores with lots of plugins or complex setups. If you run into any issues, it’s sometimes best to consult a WooCommerce developer for help.
In Closing
While the process of renaming country codes in WooCommerce is relatively simple, tailoring your store to customers in different regions can get far more intricate.
If you need to set different product prices based on location, hide certain products from specific countries, or have other complex location-based customizations in mind, consider exploring Aelia’s Prices by Country for WooCommerce plugin.
This powerful tool gives you granular control over your product pricing and visibility based on customer location.
Want to learn more or need help with advanced WooCommerce customizations? We’d love to hear from you!
Aelia Receives All-Star Quality Mark from AIBF for the second year in a row
Our beloved Grinzing, located in one of the most beautiful districts of Vienna, has received a massive boost this week with one of the resident businesses achieving international recognition for excellence, confirming its highest standards of service and trust. Diego Zanella, the founder of Aelia, was awarded the coveted All-Ireland Business All-Star accreditation for the second year in a row. One might ask why an Austrian business, founded by an Italian entrepreneur, would receive such an important accreditation from a foreign country, and it would be a legitimate question. The answer is simple, yet interesting.
Some background story
Diego Zanella founded Aelia in Ireland, in 2013. From the first day, he founder focused all its efforts in producing high quality solutions, and offering top class service, to owner of e-commerce websites. Thanks to the flexibility offered by modern technologies, the business can operate from anywhere in the world, while still keeping in touch with its thousands of customers. Aelia moved around Ireland a couple of times, then, in mid-2019, Diego Zanella planned a relocation to Austria.
The All-Ireland Business Foundation came into play, just in time
At the beginning of the same year, he had submitted Aelia to the selection for the Business All-Star accreditation. He was supposed to receive answer was supposed within a couple of days, and the selection process take a few weeks. However, due to a technical issue, the submission remained “pending” much longer than it should have. As soon as the All-Ireland Business Foundation Team found it, they reviewed the performance of both Aelia and its founder. The score was high enough to place them amongst the top candidates. Even though our founder informed the AIBF Team of the imminent relocation abroad, they were more than happy to let our application proceed anyway. Then, in October 2019, Diego Zanella received the first Business All-Star accreditation.
In 2020, the AIBF Team contacted our founder again. Although our Aelia and its founder are no longer resident in Ireland, their result were so high that the Foundation offered to make an exception, and participate to the selection again. Diego Zanella was given the opportunity to become the first “ex-indigenous entrepreneur” to be accredited by the All-Ireland Business Foundation.
Obviously, since we’re writing about it, the result was a success. At the end of October 2020 (yes, we’re a bit slow with news), Aelia’s founder received the accreditation certificate, confirming Diego Zanella as a Thought Leader in e-commerce and WooCommerce solutions.
Due to the ongoing COVID-19 pandemic, the Gold Medal Ceremony was replaced by an online event. Our founder, Diego Zanella, attended it on the 30th of October, 2020.
The importance of get accredited for the second year
Like in 2019, we are pleased to have reached the high standard required by the the Business All-Star accreditation. We strive to keep high level of performance, trust and customer satisfaction that distinguishes our offer . Furthermore, we are the first to having been invited to participate into the selection, despite the business being now resident in another EU country, and it feels like a special honour. The All-Ireland Business Foundation is so impressed by our results that they would like to keep us in their register of top class companies. 👍
We would like to thank everyone for your continued support. Our customers, who keep trusting, our business partners, with whom we will be working on more incredible projects and, most importantly, our families.
Thanks again for your invaluable help. We wouldn’t be here, if it weren’t for you. 🙏
The Aelia Team
We received the Business All-Star Accreditation. That’s awesome!
Over the past few weeks, our founder has been working with the All Ireland Business Foundation to achieve the prestigious Business All-Star Accreditation. The examination panel informed us that our efforts has been successful, and we have reached our goal. The accreditation is a great achievement, and a demonstration that we, at Aelia, offer to our clients high quality products and a top class customer service.
Our founder, Diego Zanella, will attend the Gold Medal Ceremony on the 25th of October, 2019, at Croke Park, in Dublin, Ireland.
What this means for Aelia
It’s always great to see efforts recognised and rewarded. It’s also very exciting to know that we reached the standard required by the All-Ireland Business Foundation. The Business All-Star accreditation distinguishes progressive Irish businesses that meet a high level of verified performance, trust and customer centricity. Our efforts will now allow us to join unique group of excelling businesses.
Why we are so excited
The achievement will be celebrated at Croke Park, but reaching certainly wasn’t a “walk in the park“. 😃
We feel that this result is a tangible demonstration to our commitment in offering top quality products and services to our customers, as well as our collaborators.
We would like to thank all of you, customers, supporters, partners and suppliers, for having been with us during the past six years. Your continued support is what allowed us to be successful. We will strive to stay at the top of our class, and keeping offer you the great service you have come to expect from us.
The Aelia Team
WooCommerce Tax Display by Country – Multiple improvements – Updates
WooCommerce Tax Display by Country – What’s new
The Tax Display by Country plugin for WooCommerce has been updated to version 1.9.7.170912. This update brings the following improvements and fixes:
- Added support for the new “hashed fragments” used by the minicart since WooCommerce 3.1.2. This will ensure that the minicart displays the correct prices when the country changes.
- Added logic to preserve customer’s city and postcode, if set.
- Improved logic used to detect customer’s country and province in WooCommerce 3.0 and newer.
How to get latest version
New customers
Simply place your order and you will get the latest version.
Existing customers
You should be able to download the updated file using the link you received with your order. If the link doesn’t work, please contact Support to receive the latest version. Thanks.
EU VAT rate update – Greece – Updates
We have recently been informed that the standard VAT rate for Greece was changed on the 1st June 2016, from 23% to 24%. Some changes were made to reduced VAT rates as well.
We would recommend to take the opportunity to update the VAT rates configured in your system, to make sure that you are using the correct ones.
How to update the tax rates
Updating tax rates is a simple operation:
- Go to WordPress Admin > WooCommerce > Settings > Tax.
- Click on the tax rate you would like to update (e.g. “Standard“), at the top of the page.
- Change the rate in the row with the country code “GR” to “24”.
- Save the changes.
If you are using our EU VAT Assistant plugin, you can update all EU tax rates with a single click. Simply select the rate type at the bottom of the page and click on Update EU VAT Rates. Make sure that you select the appropriate rates (Standard or Reduced), the plugin will do the rest.
With our EU VAT Assistant you can update all VAT rates with a single click
Once the operation is completed, review the tax rates, to ensure that they are correct, and click on Save Changes. WooCommerce will now use the new rates.
Quick and easy!