How to Set a Default Country for WooCommerce Checkout

Quick answer: Go to WooCommerce → Settings → General, set Default customer location to Geolocate, and set Selling location(s) to your target country. For a hard-coded default, add the snippet below to your child theme’s functions.php.

The default country in your WooCommerce checkout is an important step for any online store. It ensures that customers have a smooth and efficient shopping experience from the moment they begin the checkout process. By pre-selecting a country, you can speed up the checkout, reduce the likelihood of errors, and provide more accurate tax and shipping calculations.

For stores operating in a single country, a default country helps simplify the buying process and keeps orders consistent. For multi-country stores, it improves the user experience by pre-filling the most common location while still allowing customers to select their own country if needed.

In this guide, we will cover everything you need to know about setting up and customising default country settings in WooCommerce, including step-by-step configuration, testing, and best practices to optimise checkout and reduce cart abandonment.

Why Setting a Default Country is Important

Setting a default country in your WooCommerce checkout can have a significant impact on the overall shopping experience. It helps streamline the checkout process, particularly for new customers, by reducing the number of fields they need to complete.

A default country also ensures that taxes and shipping costs are calculated accurately, preventing mistakes that could lead to delays or dissatisfied customers. For more advanced tax handling, you can use a plugin like Tax Display by Country for WooCommerce, which automatically adjusts tax display based on the customer’s location. By automatically pre-selecting the most likely country, you also reduce the risk of errors when shoppers forget to choose their location.

Other key benefits include:

  • Speeds up the checkout process for new and returning customers.

  • Guarantees accurate tax and shipping calculations.

  • Minimises errors caused by customers skipping the country selection.

  • Enhances overall user satisfaction and boosts store conversion rates.

WooCommerce Default Settings Overview

WooCommerce includes built-in options for handling default customer locations, which play a key role in how your store calculates taxes, shipping, and displays pricing. Choosing the right default setting ensures a smoother checkout process and better overall store performance.

Default Customer Location Options

In WooCommerce settings, you can select from the following options:

  • No location – WooCommerce will not pre-select a country, leaving the field empty for the customer to choose.

  • Shop base address – Automatically sets the default country to your store’s base location.

  • Geolocate – Detects the customer’s location using their IP address to display the appropriate country.

  • Geolocate with page caching support – Similar to geolocation, but optimised for stores using caching plugins to prevent incorrect location detection.

Default Country vs Geolocation

It’s important to understand the difference between a default country and geolocation:

  • The default country is pre-selected for all customers unless they manually change it.

  • Geolocation dynamically detects a customer’s country and adjusts checkout fields, taxes, and shipping automatically.

Choosing the right setting is crucial. Using the wrong option can lead to incorrect tax calculations, shipping errors, and a poor user experience, which may ultimately affect your conversion rates.

How to Set a Default Country in WooCommerce – Detailed Step-by-Step Process

Setting a default country in WooCommerce ensures accurate tax, shipping, and pricing calculations, while also providing a smoother checkout experience for your customers. Follow these steps to configure it correctly:

Step 1: Access WooCommerce Settings

Begin by logging in to your WordPress admin dashboard and navigating to WooCommerce > Settings. Make sure you are in the General tab, where all the location and country settings are managed.

Step 2: Set Your Store Address

Before selecting a default customer location, it’s important to confirm your store’s address. This acts as a reference point for taxes, shipping, and the fallback country if geolocation fails.

  • Enter your street address, city, and postcode.

  • Select your store country and, if applicable, the state/region.

  • This information will be used if you choose the Shop’s base address as the default customer location.

Step 3: Choose the Default Customer Location

WooCommerce provides several options for the default customer location:

  • No location – The country field remains blank, and customers must select their country manually.

  • Shop base address – Automatically sets the default country to your store’s address.

  • Geolocate – Detects the customer’s location based on their IP address, showing the correct country immediately.

  • Geolocate with page caching support – Optimised for stores using caching plugins to prevent incorrect location detection.

Step 4: Save Your Changes

Once you’ve selected the appropriate option, scroll down and click Save Changes. This ensures your settings are applied throughout the store.

Step 5: Test the Checkout

It’s important to verify that your default country is working as expected:

  • Open your store in a private browser window to simulate a new visitor.

  • Check that the default country is correctly pre-selected or dynamically detected if using geolocation.

  • Ensure taxes and shipping rates are accurately calculated based on the default location.

Using Code Snippets for a Custom Default Country

Sometimes, the built-in WooCommerce settings or plugins may not offer the exact control you need for setting a default country. In these cases, you can use a small code snippet to specify the default billing and shipping country for your checkout.

For example, you can use the following snippet:


add_filter( 'default_checkout_billing_country', function() {
    return 'GB'; // ISO 3166-1 alpha-2 code
} );
add_filter( 'default_checkout_shipping_country', function() {
    return 'GB';
} );

Where to Add the Code

  • Add the snippet to your child theme’s functions.php file.

  • Alternatively, use a code snippets plugin for safer management and easier updates.

Testing After Implementation

  • Open your store’s checkout page in a private browser window to simulate a new customer.

  • Check that the billing and shipping country fields default to your specified country.

  • Ensure that taxes, shipping, and payment calculations reflect the new default country correctly.

Setting a Default Country with Plugins

For WooCommerce store owners who prefer not to use code, plugins offer a convenient and reliable way to set a default country at checkout. Plugins not only simplify the process but also provide a user-friendly interface to manage checkout fields, reducing the risk of errors and ensuring a smoother experience for your customers.

WooCommerce Checkout

Examples of Useful Plugins

  • WooCommerce Checkout Field Editor – This plugin allows you to customise your checkout form easily. You can add, remove, or rearrange fields and set default values for specific fields, including the billing and shipping country. It’s particularly useful for stores that want to streamline checkout for their most common customer locations.

  • Checkout Manager Plugins – These plugins provide enhanced control over all checkout fields. You can set field requirements, default values, and even conditional logic, ensuring that customers only see fields relevant to them.

  • Multi-country / Multi-currency Plugins – Some plugins designed for international stores include options to automatically set a default country based on geolocation or store preferences. This can be particularly effective for multi-country operations where taxes, shipping, or pricing differ by location.

Step-by-Step Plugin Setup For WooCommerce Checkout Field Editor

  1. Install and Activate the Plugin

    • Log in to your WordPress dashboard and navigate to Plugins > Add New.

    • Search for your chosen plugin, click Install Now, then Activate.

  2. Access Plugin Settings

    • Once activated, go to the plugin’s settings page. For the WooCommerce Checkout Field Editor, this is usually found under WooCommerce > Checkout Fields.

  3. Configure Default Country

    • Locate the billing and shipping country fields in the plugin settings.

    • Set the default country you want pre-selected for new customers. This ensures a faster checkout and reduces errors caused by customers forgetting to select their country.

  4. Save Changes

    • Click Save Changes or Update Settings to apply your configuration.

  5. Test Your Checkout

    • Open your store in a private or incognito browser window to simulate a new customer.

    • Verify that the billing and shipping country fields are correctly pre-selected.

    • Ensure taxes, shipping, and payment calculations reflect the selected default country accurately.

Using plugins like these offers a code-free, flexible solution for optimising your WooCommerce checkout. It is ideal for both single-country stores and multi-country operations, helping to improve conversion rates and enhance the overall shopping experience.

For stores selling internationally, setting a default country is just one part of creating a seamless checkout experience. To enhance this further, you can pair your WooCommerce store with a multi-currency solution such as the Aelia Currency Switcher for WooCommerce.

This powerful plugin allows your store to automatically detect a customer’s location and display product prices in their local currency. It also ensures that taxes, shipping costs, and payment calculations are accurate and fully localised. Customers can shop in their preferred currency, which reduces confusion, increases trust, and helps improve conversion rates.

Key features of the Aelia Currency Switcher include:

  • Automatic geolocation to detect the visitor’s location and set the currency accordingly.

  • Multi-currency support with the ability to display prices and process payments in various currencies.

  • Exchange rate management, either automatic or manual, so you maintain precise control over pricing.

  • Integration with WooCommerce payment gateways to filter available payment methods depending on the active currency.

  • Persistent currency selection, remembering a visitor’s preferred currency across sessions.

By combining a default country setting with Aelia Currency Switcher, your store can provide a truly localised, international-friendly checkout experience, helping reduce abandoned carts and increasing overall customer satisfaction.

Selling in multiple currencies? See the Aelia Currency Switcher.

 

How to Offer Different Product Prices per Country in WooCommerce

In today’s global eCommerce landscape, offering the same price to every customer can be limiting. Shoppers expect a retail experience that reflects their local market, including pricing, taxes, and shipping costs. This makes country-based pricing an essential feature for WooCommerce stores.

Providing different product prices for each country not only builds customer trust but also encourages higher conversion rates by making prices feel fair and localised. It also allows stores to adjust for tax variations, shipping costs, and currency fluctuations, ensuring a smooth and seamless shopping experience for international customers.

One of the most effective ways to implement this in WooCommerce is through the Prices by Country plugin, which allows store owners to set product prices according to a customer’s location. To further protect your international store, you can also use tools to prevent fraud and block malicious users in WooCommerce, helping maintain a safe and trustworthy shopping environment.

By the end of this guide, readers will understand how to implement country-specific pricing in WooCommerce step by step—from installing the plugin to configuring products and testing pricing rules—so that your store is fully optimised for international sales while providing a seamless experience for your customers.

Why Country-Specific Pricing Matters

Implementing country-specific pricing in your WooCommerce store is more than just a nice-to-have—it can significantly impact your international sales and customer satisfaction. Different countries often have variations in local taxes, shipping costs, and purchasing power, and adjusting prices accordingly ensures that your products remain attractive and competitive.

It also helps with legal compliance, such as adhering to EU VAT rules, which can vary depending on the customer’s location. Offering tailored pricing boosts customer satisfaction and can reduce cart abandonment, as shoppers are more likely to complete purchases when prices feel fair and transparent.

Some key benefits of country-specific pricing include:

  • Adjusting for local taxes, shipping costs, and purchasing power.

  • Ensuring legal compliance with tax regulations like EU VAT.

  • Boosting customer satisfaction and trust.

  • Reducing cart abandonment rates.

  • Adapting pricing strategies for different markets, e.g., USD for the US, GBP for the UK, and EUR for the Eurozone.

To simplify tax handling and display accurate prices, you can use the Aelia Tax Display by Country for WooCommerce plugin, which ensures customers always see the correct tax-inclusive price based on their location.

Introducing Prices by Country for WooCommerce

The Prices by Country for WooCommerce plugin is a powerful solution for store owners who want to set product prices according to a customer’s location. It includes robust geolocation features, automatically detecting the visitor’s country and displaying the correct prices. It can also hide products that are unavailable in a specific region, ensuring a clean and relevant shopping experience as soon as customers land on your site.

This plugin is fully compatible with the Currency Switcher for WooCommerce. When used together, you can specify prices in multiple currencies for each configured region, providing unprecedented flexibility for international pricing.

How It Works

Once the plugin is enabled, it adds a new menu item to the WooCommerce menu where you can configure one or more regions (a region is a list of countries). Every product will then show additional price fields for each of the regions. By entering prices in these fields, you can charge different prices depending on the customer’s country at checkout.

Thanks to the geolocation feature, visitors immediately see the prices that apply to their country, even before reaching the checkout. Combined with the Aelia Currency Switcher, you can set different prices in each currency for each region, giving maximum control over multi-currency and multi-region pricing.

Key Features

  • Fully compatible with Aelia Currency Switcher, enabling multi-currency, multi-region pricing.

  • Easy to use for both customers and site administrators.

  • Allows different product prices depending on the customer’s country.

  • Automatically detects visitor location and sets the appropriate price.

  • Includes a widget to allow visitors to choose their billing country before checkout.

  • Supports simple, variable, grouped, and external products.

  • Enables hiding products unavailable in specific regions.

By using the Prices by Country plugin, managing international WooCommerce stores becomes simpler, more flexible, and fully optimised for a global audience.

Set Up Your WooCommerce Store for International Sales

Before you begin setting up country-specific pricing or currency switching, it’s important to make sure your WooCommerce store is fully prepared. Taking these steps will save you headaches later and ensure a smooth transition when managing multiple currencies and locations.

Here are a few key things to check:

  • Update WooCommerce – Always make sure you’re running the latest version of WooCommerce to benefit from security patches, performance improvements, and compatibility with plugins.

  • Create a backup – Before making any major changes, back up your website and database. This way, if anything goes wrong, you can restore your store quickly without losing valuable data.

  • Check payment gateways – Not all gateways support multiple currencies. Confirm that your chosen providers (e.g., PayPal, Stripe, or others) can handle different currencies smoothly.

  • Review tax settings – Make sure your tax configuration is aligned with international requirements. For example, EU VAT rules differ from UK tax laws, so preparing these settings early will avoid compliance issues later.

By taking the time to prepare your store correctly, you’ll create a solid foundation for adding country-specific pricing and currency switching features.

Installing the Prices by Country for WooCommerce Plugin

WooCommerce prices by country

The Prices by Country for WooCommerce plugin allows you to charge different prices for each product depending on the customer’s country. It also includes geolocation features to automatically display prices and hide unavailable products. Follow these steps to install and set it up:

Step 1: Purchase or Download the Plugin

  • Visit the Aelia website and purchase the plugin.

  • You can also start with a 14-day free trial if you want to test it first.

Step 2: Upload the Plugin to WordPress

WooCommerce prices by country

  • Log in to your WordPress admin dashboard.

  • Navigate to Plugins > Add New > Upload Plugin.

  • Choose the downloaded .zip file and click Install Now.

Step 3: Activate the Plugin

  • After installation, click Activate Plugin.

  • Once activated, a new menu item Prices by Country will appear under the WooCommerce menu.

Step 4: Configure Regions

  • Go to WooCommerce > Prices by Country.

  • Create one or more regions (each region is a list of countries).

  • Once regions are configured, every product will display additional price fields for each region.

Step 5: Set Product Prices

  • Edit a product in WooCommerce.

  • Enter the specific prices for each region in the new fields provided.

  • Prices will automatically apply to customers based on their detected country.

Step 6: Enable Geolocation

  • The plugin can automatically detect a customer’s country.

  • When enabled, visitors will immediately see the correct prices, and any unavailable products will be hidden.

Step 7: Combine with Aelia Currency Switcher (Optional)

  • For maximum flexibility, use the Aelia Currency Switcher alongside this plugin.

  • This allows you to specify different prices for each currency and region, giving full multi-currency, multi-region pricing control.

Step 8: Additional Features

  • Supports simple, variable, grouped, and external products.

  • Includes a widget so visitors can select their billing country before checkout.

  • Easy for both site administrators and customers to use.

Best Practices & Advanced Tips

Once you have the Prices by Country for WooCommerce plugin installed and configured, there are several strategies you can use to make the most of it. Following these best practices will help you manage pricing efficiently and optimise your store for international customers.

  • Use regions for bulk pricing management – Group countries into regions to quickly apply pricing rules without having to set individual prices for every single country.

  • Schedule automatic updates for prices – Keep your prices accurate and competitive by scheduling updates, especially if you deal with currency fluctuations or frequent tax changes.

  • Combine with multilingual plugins – For a fully localised shopping experience, pair country-specific pricing with multilingual support so customers see prices, product descriptions, and checkout information in their own language.

  • Monitor analytics for conversion rates by country – Track how different pricing strategies impact sales in various regions and adjust your pricing rules based on performance data.

Frequently Asked Questions (FAQ)

1. How does WooCommerce detect the user’s country?
WooCommerce uses geolocation features built into plugins like Prices by Country to automatically detect a visitor’s location based on their IP address. This allows the store to display the correct prices and hide unavailable products immediately.

2. Can I use free plugins for country-specific pricing?
There are some free options, but they often lack advanced features such as geolocation, multi-currency support, or region-based pricing rules. Premium plugins like Prices by Country for WooCommerce provide more robust and reliable functionality.

3. Will this work with all payment gateways?
Most major payment gateways, such as PayPal and Stripe, are compatible. However, you should verify that your chosen gateway supports multiple currencies if you plan to combine country-specific pricing with multi-currency setups.

4. How to handle taxes and shipping differences?
Use plugins like Aelia Tax Display by Country for WooCommerce to display accurate, country-specific taxes. For shipping, configure rules in WooCommerce based on the customer’s country or region to ensure proper costs are applied.

5. Can variable products have different prices per country?
Yes. The Prices by Country plugin supports simple, variable, grouped, and external products, allowing you to set unique prices for each variation depending on the customer’s location.

 

How to Change Currency in WooCommerce Based on Customer Location

Displaying prices in a customer’s local currency not only builds trust but also encourages faster purchasing decisions. When shoppers can instantly understand the cost of products without having to convert currencies manually, it improves the overall user experience, boosts conversion rates, and reduces the likelihood of cart abandonment.

This article will guide you step-by-step on how to set up a WooCommerce currency switcher based on user location, allowing your store to automatically display the right currency to each visitor. Whether you’re new to WooCommerce or looking to optimise your international sales, this guide will help you implement a seamless, user-friendly currency experience.

Additionally, as you enhance your store’s user experience, it’s crucial to maintain its security. One effective way to protect your WooCommerce store from spam and fraud is by implementing email blacklisting. Aelia’s guide on Email Blacklisting in WooCommerce provides valuable insights on how to block unwanted email addresses, safeguarding your store from malicious users.

Why Multi-Currency is Essential for WooCommerce Stores

Providing prices in a customer’s local currency improves trust, reduces friction during checkout, and increases the likelihood of completing a purchase. It also positions your store as professional and customer-focused, which can encourage repeat business.

Here are the main reasons why multi-currency support is crucial for WooCommerce stores:

  • Meet Global Audience Expectations: Shoppers from different countries expect to see prices in their local currency. Without it, they may hesitate to complete purchases due to confusion over exchange rates or potential fees.

  • Build Trust and Psychological Comfort: Displaying prices in familiar currency enhances credibility and signals that your store caters to international customers.

  • Boost Sales Through Convenience: Instant currency conversion simplifies the checkout process, increasing conversions and reducing cart abandonment.

  • Gain a Competitive Edge: Many online stores only display a single currency. Offering multi-currency support sets your store apart, attracting more international buyers.

  • Examples of Top WooCommerce Stores Using Auto Currency Detection: Leading WooCommerce stores automatically detect a visitor’s location via IP and display the appropriate currency, providing a seamless, personalised shopping experience.

Understanding WooCommerce Currency Switcher

A WooCommerce currency switcher is a tool that enables online stores to display prices in multiple currencies, providing customers with the flexibility to view and pay in their preferred currency. Essentially, it bridges the gap between your store’s default currency and the currencies of your international audience, creating a seamless shopping experience.

There are two main types of currency switchers:

  • Manual Currency Switchers: These allow customers to select their preferred currency from a dropdown or widget. The user actively chooses the currency before adding items to the cart.

  • Automatic Currency Detection: These switchers detect the visitor’s location based on IP address and automatically display prices in the appropriate currency, removing any extra steps for the customer.

Core Features of a Good Currency Switcher

When choosing a currency switcher for your WooCommerce store, it’s important to look for the following features:

  • Auto-Detect User Location: Automatically identifies the visitor’s country and shows the correct currency.

  • Multiple Currency Support: Enables your store to handle several currencies to cater to a diverse international audience.

  • Real-Time Exchange Rate Updates: Ensures that currency conversions remain accurate and consistent with market rates.

  • Compatibility with WooCommerce Payment Gateways: Ensures a smooth checkout experience across different currencies without payment errors.

Popular WooCommerce Currency Switcher Plugins

Several plugins are widely used to add multi-currency support to WooCommerce stores, including:

  •  WooCommerce Currency Switcher: Offers both manual and automatic currency switching with real-time exchange rate updates.

  • Aelia Currency Switcher: Known for automatic geolocation-based currency detection and seamless payment gateway compatibility.

Choosing the right plugin depends on your store’s target audience, the number of currencies you want to support, and your desired level of automation.

Pre-Requisites Before Setting Up a Currency Switcher

Before you install a currency switcher on your WooCommerce shop, it’s worth making sure everything is properly set up behind the scenes. Preparing in advance helps prevent technical hiccups and ensures that the switcher works smoothly once it’s live.

Here are the key steps to tick off beforehand:

  • Keep WooCommerce Up to Date
    Always make sure your WooCommerce plugin (and WordPress itself) is running on the latest version. This avoids compatibility issues with the currency switcher and ensures your site remains secure and stable.

  • Take a Full Backup of Your Website
    Before adding any new plugin, create a complete backup of your site—including files and the database. If something goes wrong during installation, you’ll be able to restore your shop quickly without losing data.

  • Check Your Hosting Environment
    Your hosting should support the technical requirements of your chosen plugin. Many currency switchers rely on API connections for real-time exchange rates, so it’s important your server allows these connections.

  • Confirm Payment Gateway Compatibility
    Make sure your payment gateways—such as PayPal, Stripe, or other international providers—support multiple currencies. Otherwise, customers might see their local currency in your shop but still have to pay in your base currency, which can cause confusion and reduce trust.

Step-by-Step Guide to Installing and Setting Up the Aelia Currency Switcher Plugin

The Aelia Currency Switcher is a powerful plugin that lets your WooCommerce shop display prices in multiple currencies, automatically detect the customer’s location, and process payments in the chosen currency. Below is a simplified step-by-step guide to installing and configuring it.

1. Install and Activate the Plugin

  • Purchase the plugin from the Aelia website and download the installation file.

  • In your WordPress dashboard, go to Plugins > Add New > Upload Plugin.

  • Upload the .zip file, click Install Now, and then Activate.

  • Once activated, you’ll find the settings under WooCommerce > Currency Switcher.

Tip: If you don’t see the settings link, check Aelia’s knowledge base for a quick fix.

2. Configure Your Currency Options

Before you dive into setup, decide which currencies you actually want to support. It’s best to keep this limited to the currencies most relevant to your business. Enabling too many can clutter your site and confuse customers.

  • Go to WooCommerce > Currency Switcher.

  • Add the boxes for the currencies you’d like to enable.

  • Click Save to update your list.

2.1 Review Currency Settings

After saving, you’ll see each selected currency with its exchange rate. Here you can fine-tune settings:

  • Exchange Rate – The conversion rate from your base currency (can be automatic or manual).

  • Enable automatic updating: Tick this box to allow automatic updates of exchange rates.

  • Separators & Decimals – Choose how often you want the system to refresh the rates (e.g., Once Daily).

  • Currency Symbol & Position – Select which provider to use — in this case, Open Exchange Rates.

Tip: Automatic exchange rates are usually best. Manual rates are possible, but can skew sales reports if not updated regularly.

2.2 Enable Geolocation

The geolocation feature automatically detects a visitor’s country and shows prices in the correct currency.

  • Open the Geolocation tab in the plugin settings.

  • Tick the box to enable geolocation.

  • Choose a default currency (e.g, GBP or EUR) for visitors from unsupported countries.

Advanced users can even assign specific currencies to groups of countries using filters.

2.3 Set Up Payment Gateways

Since all orders are processed in the customer’s chosen currency, you must enable at least one payment gateway per currency.

  • Go to WooCommerce > Currency Switcher > Payment.

  • Tick the gateways (PayPal, Stripe, etc.) that should be available for each currency.

  • Remember: whenever you add a new payment method, revisit this section to assign it to the correct currencies.

2.4 Choose How Customers Select Currency

Aelia gives you flexibility in how customers can switch currencies:

  • Via URL: Add a special URL parameter to switch currency.

  • By Country: Force currency based on billing or shipping country.

  • Currency Selector Widget: Allow customers to change currency manually via a dropdown or menu.

If you lock currency by country, you’ll need to hide the currency selector so customers can’t override it.

2.5 Debug Mode (Optional)

If something doesn’t work, you can enable Debug Mode under the Support tab. This logs plugin activity and is very useful when contacting Aelia’s support team.

2.6 Add the Currency Selector Widget

Finally, let customers choose their preferred currency from the front-end:

  • Go to Appearance > Widgets and add the Currency Selector to your sidebar, footer, or menu.

  • Alternatively, use a shortcode to display it anywhere on your site.

If you’d like a more detailed walkthrough, check out this guide on displaying the currency switcher widget anywhere.

3. Test Your Setup

Before going live, test thoroughly:

  1. Visit your shop front-end and switch between currencies.

  2. Add a product to your basket and check the price in the selected currency.

  3. Proceed to checkout to confirm that products, shipping, and totals are displayed correctly.

  4. Place a test order and check the order emails — they should show the correct currency.

  5. Review the order in WooCommerce > Orders — you’ll see the customer’s chosen currency and its equivalent in your base currency.

 That’s it! Your WooCommerce shop is now running with the Aelia Currency Switcher, giving your customers a seamless multi-currency shopping experience.

 

 

 

How to Restrict WooCommerce Products by Country

When you run an online store, it’s easy to think that selling to everyone, everywhere, is always a good idea. But the truth is a bit more complicated. Not every product can or should be available in every country. Some items have legal restrictions, shipping to certain regions can be tricky or expensive, and digital products often have licensing limits. Overlooking these factors can lead to frustrating situations—like unhappy customers, costly refunds, or even fines. One way to add extra protection for your store is by using a security plugin to block fraudulent WooCommerce users, helping you prevent fraud while managing international sales.

Restricting product availability by country isn’t just about avoiding problems—it’s smart business. It helps you stay compliant with local laws, keeps your shipping and logistics under control, and allows you to focus marketing efforts on the regions where your products are available. This means better engagement, fewer headaches, and more sales in the right places.

In this guide, we’ll show you why country restrictions matter, walk you through how to set them up step by step, and highlight the tools that make WooCommerce stores smarter and safer. By the end, you’ll know exactly how to control where your products are available, protecting your business and keeping your customers happy.

Understanding WooCommerce Country Restrictions 

“Country restrictions” in e-commerce simply means limiting where your products can be sold—or even seen—based on the customer’s location. It’s more than just blocking sales; it’s about running your store legally, efficiently, and strategically across different regions.

There are several common scenarios where country restrictions come into play:

  • Shipping limitations: Not every carrier delivers to every country, and international shipping can be expensive. Restricting sales to countries you can reliably ship to helps prevent disappointed customers and costly returns.

  • Tax regulations: Different countries have their VAT, GST, or import duty rules. Selling without accounting for these can result in fines or compliance issues.

  • Digital product restrictions: Software, e-books, and other digital products often come with regional licensing agreements that limit distribution to specific countries.

  • Licensing issues for physical goods: Certain products, like alcohol, pharmaceuticals, or specialised equipment, may only be legally sold in specific regions.

It’s also important to understand the difference between restricting purchasing and restricting viewing products:

  • Restricting purchasing: Customers can see the product, but cannot complete the checkout if they’re in a restricted country. This approach is useful if you want to showcase products globally without violating regulations.

  • Restricting viewing: Customers in certain countries won’t even see the product listed. This avoids disappointment and makes your store experience cleaner for users outside your target regions.

WooCommerce makes managing both types of restrictions straightforward. With built-in geolocation features, your store can automatically detect a visitor’s country and enforce your rules. This ensures your business remains compliant while providing a smoother, more transparent shopping experience for your customers.

To prevent such issues, it’s a good idea to limit access to your WooCommerce store or specific products for certain countries.

In this guide, we’ll walk you through simple steps to restrict your WooCommerce store and products based on location. Below is a quick overview of the methods we’ll cover—you can jump directly to any section using the links:

  • Method 1: Restrict Countries Using WooCommerce Settings (No Plugin)

  • Method 2: Add Country-Based Restrictions for WooCommerce Products (Using a Plugin)

Let’s dive in!

Method 1: Restricting Countries Using WooCommerce Settings 

WooCommerce comes with built-in options that make it simple to restrict access to your store based on a customer’s country—without the need for any additional plugins. This method is perfect for store owners who want a quick solution to control where their products are sold.

Step 1: Access WooCommerce Settings

Start by logging into your WordPress dashboard. Navigate to WooCommerce → Settings and click on the General tab. This section contains all the fundamental store settings, including location and currency options, which are essential when managing country restrictions.

Step 2: Locate the Selling Locations

WooCommerce Country Restrictions

Scroll down to the General Options section until you find Selling Location(s). This dropdown menu determines where your products are available for sale. You will see three options:

  • Sell to all countries – Your products are available worldwide.

  • Sell to specific countries – Only allow customers from the selected countries to purchase.

  • Sell to specific countries, except for – Sell everywhere except the countries you explicitly exclude.

Step 3: Choose Your Restriction Method

Depending on your business needs, select one of the options:

WooCommerce Country Restrictions

  • Sell to specific countries, except for…: A new field will appear where you can pick the countries you want to block. This is useful if your store ships globally but you want to exclude certain regions due to shipping limitations, tax regulations, or legal restrictions.

  • Sell to specific countries: A field will appear allowing you to select only the countries where your store will be accessible. Customers outside these regions will not be able to complete purchases.

Step 4: Save Your Changes

WooCommerce Country Restrictions

After selecting the countries, click Save Changes at the bottom of the page. WooCommerce will now enforce these restrictions automatically. Customers from blocked countries will not be able to check out, and depending on your store settings, they may see a message informing them that your products are unavailable in their region.

Pros and Cons of This Method

Pros:

  • Quick and easy: No technical knowledge or additional plugins are required.

  • Integrated solution: Uses WooCommerce’s native features, so it’s fully supported and maintained.

  • Ideal for global stores with limited exclusions: Great for excluding just a few countries without complex configurations.

Cons:

  • Store-wide restriction only: You cannot limit access to individual products—restrictions apply to your entire store.

  • Limited customization: There’s no option to show custom messages or alternative products for restricted countries.

  • Not suitable for advanced targeting: If you want to show different products, prices, or offers based on a customer’s location, you’ll need a plugin or custom solution.

This method works best when your goal is to control overall store availability rather than restricting individual products. If you need finer control—like hiding specific items or setting different prices per country—you can use a plugin-based solution, such as Prices by Country for WooCommerce, which allows more granular settings and advanced targeting options.

Method 2: Add Country-Based Restrictions with Aelia Blacklister for WooCommerce

If you want more control over who can place an order in your store, the Aelia Blacklister for WooCommerce plugin is a powerful solution. Unlike simple catalog visibility tools, this plugin works by blocking orders at checkout whenever they match the rules you’ve defined. One of its most effective features is the ability to block customers by their IP address. Since IPs can be linked to geographic regions, this makes it possible to stop fraudulent activity or prevent orders from certain countries altogether.

Here’s a simple step-by-step process to set it up:

  • Step 1 – Install and Activate the Plugin
    Purchase and install the Aelia Blacklister for WooCommerce plugin from the official source. Once activated, a new Blacklister menu will appear in your WooCommerce dashboard.

  • Step 2 – Access the Blacklister Settings
    Go to WooCommerce → Blacklister. This is where you’ll manage all your blacklist rules.

  • Step 3 – Add IP Address Rules
    In the rules section, add the IP addresses you want to block. You can:

    • Enter a single IP (e.g., 192.168.1.10)

    • Use IP ranges (e.g., 192.168.1.*)

    • Apply IP masks for broader coverage (e.g., 192.168.*.*)

  • Step 4 – Block by Country (via IP Ranges)
    To block entire countries, you can input the range of IP addresses associated with that country. There are publicly available IP-to-country databases you can use to find these ranges.

  • Step 5 – Customise the Error Message
    Configure the message that blocked customers will see at checkout (e.g., “We’re sorry, but we currently do not accept orders from your region.”).

  • Step 6 – Save and Test
    Save your changes and run a quick test using a VPN or proxy from the restricted country to ensure the rule is working correctly.

With this method, you’re not just hiding products—you’re actively preventing orders from unwanted locations, giving your WooCommerce store an extra layer of fraud protection.

Method 2: Add Country-Based Restrictions with Aelia Blacklister for WooCommerce

If you need stronger protection than simply hiding products, the Aelia Blacklister for WooCommerce plugin gives you full control over who can place an order in your store. Instead of just limiting catalog visibility, it blocks checkout attempts when customers match blacklist rules that you define.

One of the most effective tools this plugin offers is IP address filtering. Since every visitor to your store comes with a unique IP that can often be mapped to a region or country, you can use this feature to stop fraudulent orders, avoid high-risk countries, or comply with shipping restrictions.

Here’s how to set it up step by step:

Step 1 – Install and Activate the Plugin

WooCommerce Country Restrictions

  1. Go to the Aelia Blacklister for WooCommerce page and purchase the plugin.

  2. Download the plugin .zip file.

  3. From your WordPress dashboard, go to Plugins → Add New → Upload Plugin.

  4. Upload the .zip file and click Install Now.

  5. Once installed, click Activate Plugin.

 After activation, you’ll see a new Blacklister menu inside your WooCommerce settings.

Step 2 – Access the Blacklister Settings

  1. From your dashboard, go to WooCommerce → Blacklister.

  2. This is where you’ll manage all blacklist and whitelist rules.

  3. The interface is designed to let you add rules for IP addresses, email domains, billing/shipping countries, and regions.

Step 3 – Block Customers by IP Address

WooCommerce Country Restrictions

You can add individual IP addresses or patterns to block specific visitors. Examples:

  • Single IP192.168.1.10 (blocks just that user).

  • IP Range192.168.1.* (blocks anyone within that subnet).

  • Wildcard/Mask192.168.*.* (blocks entire blocks of IPs, covering a much larger group).

 This is useful if you’ve noticed repeated fraud attempts or spam orders from the same network.

Step 4 – Block Entire Countries Using IP Ranges

If you want to prevent orders from specific countries, you can block all the IP ranges associated with that country.

  • Find IP ranges by country using public databases like:

  • Copy the IP ranges for the country you want to block.

  • Paste those ranges into the IP blacklist field.

 This ensures that all visitors from that country are blocked at checkout, even if they try different billing/shipping details.

Step 5 – Customise the Block Message

Instead of just denying access silently, you can display a friendly, professional error message.

Example:

“We’re sorry, but we do not currently accept orders from your region. Please contact us if you think this is an error.”

 This makes the restriction clear to customers and avoids confusion.

Step 6 – Save & Test the Rules

  1. Click Save Changes.

  2. To make sure your setup works, test it using a VPN or proxy service that lets you connect from the blocked country or IP.

  3. Attempt to place an order — you should see your custom error message.

Why this method works well:

  • Unlike simple catalog restrictions, it prevents checkout fraud directly at the source.

  • Gives flexibility with both individual IPs and whole countries.

  • Adds a professional customer-facing message instead of silently rejecting orders.

  • Great for stores that have high fraud exposure or those that cannot legally ship to certain countries.

WooCommerce Shortcodes List: Examples, Attributes, and Advanced Usage

On this page

If you’re building an online store with WordPress, chances are you’ve come across WooCommerce—the platform powering millions of successful shops worldwide. It’s flexible, feature-packed, and works brilliantly for selling everything from physical products to digital downloads. But here’s something many store owners overlook: WooCommerce comes with a hidden superpower—shortcodes. These small, bracketed snippets let you instantly add store features anywhere on your site without writing a single line of code.

The beauty of WooCommerce shortcodes is in their versatility. You can use them to showcase best-selling items, create a tailored checkout page, embed your shopping cart on any landing page, or even spotlight specific product categories. They work in posts, pages, widgets—anywhere WordPress supports content. Whether you’re new to eCommerce and want quick customisation, a developer building unique layouts, or a business owner running time-sensitive promotions, shortcodes make it easy. And while adding features is important, keeping your store safe matters too—check out this guide on protecting your WooCommerce store from suspicious users and IP addresses to ensure your site runs smoothly. In this guide, we’ll cover how to use WooCommerce shortcodes, share practical WooCommerce shortcode examples, and reveal tips to get the most out of them.

What Are WooCommerce Shortcodes?

In WordPress, a shortcode is a small text snippet wrapped in square brackets that acts as an instruction for the system to display a specific feature or type of content. Instead of writing complicated code, you simply place the shortcode into a page, post, or widget, and WordPress replaces it with the intended output automatically.

WooCommerce takes this concept further by providing its own set of shortcodes designed specifically for online shops. These allow you to add dynamic store elements—such as product listings, shopping carts, checkout forms, or account pages—anywhere on your site.

Key differences between WordPress and WooCommerce shortcodes

  • WordPress shortcodes – General-purpose, can be used for things like image galleries, contact forms, or embedded videos.

  • WooCommerce shortcodes – Specialised for eCommerce, working directly with product data, cart systems, and checkout processes.

Advantages of using WooCommerce shortcodes

  • Time-saving – No need to build layouts from scratch or write PHP.

  • Beginner-friendly – Works with simple bracket syntax instead of coding.

  • Flexible placement – Can be added to posts, pages, widgets, and even custom templates.

  • Dynamic content – Automatically pulls live product data from your store.

For example, if you wanted to display four products in a grid on any page, you could simply use

[products limit="4" columns="4"]

This shortcode tells WooCommerce to show four products in four columns, perfect for a homepage section or promotional landing page. With just a few words in brackets, you can achieve results that would normally require a developer’s time and effort.

How to Use WooCommerce Shortcodes (Step-by-Step)

WooCommerce shortcodes are incredibly flexible and can be placed almost anywhere on your WordPress site. Whether you’re working in the Classic Editor, Gutenberg, or a page builder like Elementor or WPBakery, shortcodes make it easy to insert store features without any coding.

1. Where You Can Place Shortcodes

You can use WooCommerce shortcodes in a variety of locations, including:

  • Pages – Great for creating custom shop, checkout, or promotional landing pages.

  • Posts – Ideal for blog articles that promote specific products or sales.

  • Widgets – Add products or categories to sidebars and footers.

  • Gutenberg blocks – Insert shortcodes directly inside content blocks.

  • Page builders – Most modern builders have shortcode elements you can drag and drop.

This flexibility means you can display your store content exactly where you want it, rather than being limited to WooCommerce’s default layouts.

2. Adding Shortcodes in the Classic Editor vs. Gutenberg

Classic Editor:

  1. Open the page or post where you want to display the WooCommerce element.

  2. Paste the shortcode directly into the content area.

  3. Update or publish the page to see the result.

Gutenberg Editor:

  1. Click the + icon to add a new block.

  2. Search for the Shortcode block and select it.

  3. Paste your shortcode inside the block.

  4. Preview or publish to see it in action.

3. Using Shortcodes with Elementor or WPBakery

Elementor:

  • Drag the Shortcode widget onto your page.

  • Paste your WooCommerce shortcode into the widget settings.

  • Style the surrounding layout with Elementor’s design tools.

WPBakery Page Builder:

  • Use the Raw HTML or Text Block element.

  • Paste your shortcode inside, save, and publish.

These page builders make it easy to combine WooCommerce functionality with custom designs, giving you full creative control.

4. Tips for Customising Shortcode Attributes

Most WooCommerce shortcodes have attributes—extra settings inside the shortcode that change how it works. For example:

[products limit="8" columns="4" category="t-shirts" orderby="date" order="DESC"]

Here’s what’s happening:

  • limit – Number of products to display.

  • columns – How many columns to show.

  • category – Only display products from a specific category.

  • orderby / order – Control the sorting (e.g., newest first).

You can combine multiple attributes to create highly targeted product displays.

5. Common Mistakes to Avoid

  • Incorrect spelling – Shortcodes must be typed exactly as shown, without spaces inside the brackets.

  • Using the wrong category slug – Ensure the category name matches its slug (lowercase, no spaces).

  • Forgetting to close the shortcode – While most WooCommerce shortcodes don’t require a closing tag, some do.

  • Using too many at once – Overloading a page with multiple product shortcodes can slow down performance.

  • Not checking mobile layouts – Shortcodes may look fine on desktop, but need adjustment for smaller screens.

Overview of Default WooCommerce Shortcodes:

ShortcodeDescription
[woocommerce_cart]Displays the cart page.
[woocommerce_checkout]Displays the checkout page.
[woocommerce_my_account]Displays the user account page.
[woocommerce_order_tracking]Displays the order tracking form; supports attributes.
[product_page]Displays a full single product page by ID or SKU.
[products]Displays multiple products based on parameters like category, tag, limit, and order.
[product_category]Shows products from a specified category with customisable layout options.
[product_categories]Displays a list or grid of product categories with optional filtering.
[add_to_cart]Displays an “Add to Cart” button for a specific product with optional styling.
[add_to_cart_url]Retrieves the URL for a product’s add-to-cart button; useful for custom links.
[shop_messages]Shows WooCommerce system messages (e.g., errors, notices) on non-shop pages.
[featured_products]Displays products marked as featured in a grid layout.
[sale_products]Shows products currently on sale with customisable display options.
[best_selling_products]Highlights your store’s best-selling products.
[top_rated_products]Displays products with the highest customer ratings.
[recent_products]Lists the most recently added products.
[related_products]Shows products related to the current product being viewed.
[product_attribute]Displays products filtered by a specific product attribute like color or size.

List of Common WooCommerce Shortcodes

WooCommerce offers a range of shortcodes that help you add powerful eCommerce features to your WordPress site quickly and easily. These shortcodes work only if you have WooCommerce installed and activated on your website.

WooCommerce Cart Shortcodes:

1. Cart
[woocommerce_cart]

This shortcode displays the contents of the shopping cart, including product thumbnails, names, prices, quantities, and the subtotal. It supports several parameters that let you customise the output, such as columns, show_shipping, show_coupon, show_totals, and button_text.

Example: [woocommerce_cart columns="2" show_shipping="true" show_coupon="true" button_text="Proceed to Checkout"]

This will display the shopping cart with 2 columns, shipping options, a coupon code field, and a checkout button labeled “Proceed to Checkout”.

2. Cart Total
[woocommerce_cart_total]

This shortcode shows the total price of the shopping cart. You can customise it using parameters like class and before.

Example: [[woocommerce_cart_total class=”my-cart-total” before=”Total: “]]

This will display the cart total with a custom CSS class and the prefix “Total: ” before the amount.

3. Cart Coupon
[woocommerce_cart_coupon]

This shortcode adds a coupon code input field on the shopping cart page. It accepts parameters such as class and placeholder.

Example: [woocommerce_cart_coupon class=”my-cart-coupon” placeholder=”Enter coupon code”]

This will display the coupon field with a custom class and placeholder text “Enter coupon code”.

4. Cart Shipping
[woocommerce_cart_shipping]

This shortcode displays the shipping options available on the cart page. You can modify it using parameters like class and before.

Example: [[woocommerce_cart_shipping class=”my-cart-shipping” before=”Shipping: “]]

This will show the shipping methods with a custom class and the label “Shipping: ” before the options.

5. Cart Contents
[woocommerce_cart_contents]

This shortcode outputs the cart contents in a table format. It supports parameters such as class, before, and after to customise the HTML structure.

Example: [woocommerce_cart_contents class=”my-cart-contents” before=”<table>” after=”</table>”]

This will display the cart items inside a table with a custom class and custom HTML tags wrapping the content.

WooCommerce Checkout Shortcodes

1 Checkout

This shortcode displays the full checkout form with all necessary fields for customers to complete their purchase. It supports parameters like order_review, terms, privacy_policy, and login_form to customise the checkout experience.

Example: [woocommerce_checkout order_review="false" terms="true" privacy_policy="true" login_form="false"]

This will show the checkout form without the order review section but with the terms and privacy policy checkboxes enabled.

2. Checkout & Cart
[woocommerce_checkout_cart]

This shortcode displays the shopping cart contents on the checkout page. It includes parameters such as show_shipping, show_coupon, and show_cart to control which elements are visible.

Example: [[woocommerce_checkout_cart show_shipping=”true” show_coupon=”false” show_cart=”false”]]

This setup displays the cart contents with shipping options but hides the coupon code field and cart totals.

3. Checkout Order Review
[woocommerce_checkout_order_review]

This shortcode renders the order review section on the checkout page, including the product list, shipping details, and total cost. You can customise it with parameters like show_shipping, show_coupon, and show_cart.

Example: [[woocommerce_checkout_order_review show_shipping=”false” show_coupon=”false” show_cart=”false”]]

This example shows only the order review section without shipping, coupon, or cart details.

4. Checkout Fields
[woocommerce_checkout_fields]

Use this shortcode to display specific checkout fields such as billing and shipping addresses, payment methods, and order notes. Parameters include order, fields, and required to specify which fields appear and which are mandatory.

Example: [[woocommerce_checkout_fields order=”billing,shipping” fields=”first_name,last_name,email,phone” required=”first_name,last_name,email”]]

This will display billing and shipping fields for first name, last name, email, and phone, requiring the first name, last name, and email fields to be filled out.

WooCommerce Product Shortcodes: Detailed Guide with Examples

1. Products

[products]

This shortcode displays a grid of multiple products on your page, complete with pagination and sorting features. You can filter and customise the products shown by using various parameters such as:

  • category — show products from a specific category

  • tag — filter products by product tags

  • limit — number of products to display

  • columns — number of columns in the grid

  • orderby — sorting criteria (e.g., date, price, popularity)

  • order — ascending (asc) or descending (desc) order

Example:
[products limit="4" columns="2" orderby="price" order="asc"]
This shortcode will display 4 products arranged in 2 columns, sorted by price in ascending order (lowest price first).

2. Product Category

[product_category]

Use this shortcode to display products from a single product category. It shares many parameters with the [products] shortcode, letting you control the number of items, layout, and sorting.

  • category — slug of the product category

  • limit — how many products to show

  • columns — number of columns

  • orderby and order — sorting options

Example:
[product_category category="clothing" limit="6" columns="3"]
This will show 6 products from the “clothing” category arranged in 3 columns.

3. Products by SKU

[[products_by_sku]]

This shortcode lets you display specific products by listing their SKUs (Stock Keeping Units). It’s useful when you want to showcase particular items without relying on categories or tags.

  • skus — comma-separated list of product SKUs

  • limit — maximum number of products to display

Example:
[[products_by_sku skus="ABC123, DEF456, GHI789" limit="3"]]
This will display 3 products identified by the SKUs ABC123, DEF456, and GHI789.

4. Recent Products

[recent_products]

Displays your newest products in a grid. Parameters allow you to specify the number of items and their layout.

  • limit — number of recent products to show

  • columns — number of columns

Example:
[recent_products limit="8" columns="4"]
This shortcode will show 8 recently added products arranged in 4 columns.

5. Best Selling Products

[best_selling_products]

Showcases your top-selling products, helping highlight popular choices in your store.

  • limit — how many best sellers to display

  • columns — grid layout columns

Example:
[best_selling_products limit="10" columns="5"]
Displays the top 10 best-selling products in 5 columns.

6. Single Product

[product]

Use this shortcode to display a single product on any page or post. You can identify the product by its ID or SKU.

  • id — product ID

  • sku — product SKU

Example:
[product id="123"]
This will show the product with the ID 123, including all its details like images, description, and price.

7. Product Attribute

[product_attribute]

Display products filtered by a specific attribute such as color, size, or material. This shortcode is handy for showcasing items sharing a particular characteristic.

  • attribute — the attribute name (e.g., color)

  • terms — attribute values to filter by (e.g., red)

  • operator — how to match terms (AND, OR)

  • limit — number of products

  • columns — number of columns

Example:
[product_attribute attribute="color" terms="red" operator="OR" limit="6" columns="3"]
This shows up to 6 products with the “red” color attribute in a 3-column grid.

8. Featured Products

[featured_products]

Displays products marked as featured in your WooCommerce store. Perfect for highlighting special items on your homepage or landing pages.

  • limit — number of featured products to show

  • columns — layout columns

Example:
[featured_products limit="8" columns="4"]
This will display 8 featured products in 4 columns.

9. Product Tags

[[product_tags]]

This shortcode lists product tags with links to their archives, helping visitors browse products by tags.

  • exclude — IDs of tags to exclude

  • orderby — sort criteria (e.g., name, count)

  • order — ascending or descending

Example:
[[product_tags exclude="15,20" orderby="count" order="DESC"]]
This lists product tags ordered by the number of products, excluding tags with IDs 15 and 20.

10. Product Page

[product_page]

Embed a full product page for a specific product by ID anywhere on your site.

  • id — product ID

Example:
[product_page id="123"]
This displays the entire product page for product 123, including images, description, reviews, and purchase options.

11. Product Reviews

[[product_reviews]]

Shows a list of reviews for a specific product. You can limit how many reviews to display.

  • id — product ID

  • limit — number of reviews

Example:
[[product_reviews id="123" limit="5"]]
This will display up to 5 reviews for product 123.

12. Product Description

[[woocommerce_product_description]]

Displays the description section of a product on your page.

13. Product Price

[[woocommerce_product_price]]

Shows the current price of a product.

WooCommerce Order Tracking and User Account Shortcodes

Order Tracking Form

[woocommerce_order_tracking]

This shortcode adds a simple, user-friendly form that allows customers to track the status of their orders directly on your website. By entering their order ID and billing email address, customers can quickly view updates such as shipping progress, delivery status, and order completion without needing to log in.

This feature improves customer experience by providing transparent order tracking and reducing support requests.

Example:
[woocommerce_order_tracking]

Simply place this shortcode on any page where you want customers to have access to order tracking. It will display a clean form with two input fields and a submit button.

User Account Dashboard

[woocommerce_my_account]

This shortcode creates the customer account dashboard, a secure area where registered users can manage their personal information and order history. It includes sections for:

  • Viewing recent and past orders

  • Downloading digital products

  • Editing billing and shipping addresses

  • Changing account passwords and details

  • Managing subscriptions (if applicable)

When users are not logged in, this shortcode automatically displays login and registration forms, making it easy for new and returning customers to access their accounts.

Example:
[woocommerce_my_account]

Add this shortcode to a page titled “My Account” or similar to provide customers with a seamless way to manage their profiles and orders.

How to Troubleshoot WooCommerce Shortcode Issues

If you’re encountering issues with WooCommerce shortcodes not functioning as expected, follow these steps to identify and resolve the problem:

  1. Confirm WooCommerce is Installed and Activated
    Make sure the WooCommerce plugin is installed and active on your WordPress site. Without WooCommerce, none of its shortcodes will work.

  2. Verify Shortcode Syntax
    Check that you’re using the correct shortcode syntax, including square brackets [ ] and proper parameters. Refer to the official WooCommerce documentation for guidance.

  3. Check for Plugin Conflicts
    Other plugins may interfere with WooCommerce shortcodes. Temporarily deactivate other plugins and test your shortcodes. If the problem resolves, reactivate plugins one by one to find the conflict. If you’re managing user roles or want to block unwanted users to reduce conflicts, consider tools like Blacklister for WooCommerce.

  4. Switch to a Default Theme
    Your active theme might be causing the issue. Switch to a default WordPress theme (like Twenty Twenty-One) temporarily to see if the shortcode works.

  5. Clear Caches
    Caching plugins or server caches may prevent updates from appearing. Clear all caches and reload your site.

  6. Contact WooCommerce Support
    If none of the above solves the issue, reach out to WooCommerce support for detailed help.

Frequently Asked Questions

  1. How do I add WooCommerce shortcodes to my pages?
    To add WooCommerce shortcodes, simply edit your WordPress page or post. If you’re using the Gutenberg editor, add a “Shortcode” block and paste the shortcode like [products]. For the Classic Editor, paste the shortcode directly where you want it to appear. When saved, the shortcode will show the corresponding WooCommerce content dynamically.

  2. Can I use multiple WooCommerce shortcodes on the same page?
    Yes, you can add multiple WooCommerce shortcodes on a single page to show different elements like product grids, the shopping cart, and the checkout form. Just ensure each shortcode is placed properly and they don’t visually conflict.

  3. Why aren’t my WooCommerce shortcodes working?
    Common reasons include the WooCommerce plugin not being activated, incorrect shortcode syntax, conflicts with other plugins or themes, or caching issues. Check these areas to fix the problem.

  4. Can I customise which products are shown using shortcodes?
    Yes, many product shortcodes support parameters like limit, columns, orderby, and category to control which products display and how they’re arranged.

  5. How do I display products from a specific category?
    Use the shortcode [product_category category="category-slug" limit="6" columns="3"], replacing “category-slug” with your actual product category name.

  6. Can I add an Add to Cart button for a single product anywhere?
    Yes! Use [add_to_cart id="123"], replacing 123 with the product ID, to add an Add to Cart button anywhere on your site.

  7. Are WooCommerce shortcodes mobile-friendly?
    Yes, WooCommerce shortcodes are designed to be responsive and adapt well to mobile devices.

  8. Can I restrict shortcode content based on user roles?
    WooCommerce doesn’t offer this natively, but you can use plugins or custom code to restrict shortcode visibility by user role.

Multi-currency shortcodes: selling the same page in more than one currency

Every shortcode above outputs prices in a single currency, the store’s base currency. WooCommerce has no shortcode that converts a price, or that switches a visitor to the currency they actually spend in, because currency handling is not part of WooCommerce core.

The Aelia Currency Switcher adds four shortcodes that cover this. They work anywhere the WooCommerce shortcodes above work: pages, posts, text widgets, and theme templates via do_shortcode().

Currency selector widget

Places a currency selector in the body of a page rather than leaving it in a sidebar. Example: [aelia_currency_selector_widget title="Choose your currency" widget_type="dropdown_flags"]

The widget_type attribute accepts dropdown (the default), dropdown_flags or buttons. The currency_display_mode attribute accepts show_currency_code to show EUR, GBP, USD, or show_currency_name to show Euro, Pound Sterling, United States Dollar.

Billing country selector

For stores that set the currency from the billing country instead of letting the customer choose it. Example: [aelia_cs_country_selector_widget title="Delivery country" widget_type="dropdown"]

Product price in a specific currency

Prints one product’s price, either in the currency the visitor is browsing in or in a currency you name. Useful on landing pages and comparison tables, where a hardcoded price goes stale the moment you change it in the catalogue. Example: [aelia_cs_product_price product_id="123" price_type="price" formatted="1" currency="USD"]

The price_type attribute accepts price, regular_price, sale_price, and sign_up_fee for subscription products. Set formatted to 1 for a currency symbol and thousand separator, or 0 for a raw number you can calculate with. Omit currency and the price follows whichever currency the visitor has selected.

Convert any amount

Converts a figure that is not attached to a product. This is the one for free-shipping thresholds, pricing tables and “from” copy that should follow the visitor’s currency instead of being rewritten by hand for every market. Example: [aelia_cs_currency_amount amount="49.00" from_currency="GBP" to_currency="EUR" formatted="1"]

The full attribute reference for all four is in the Aelia Currency Switcher shortcodes article.

If you are placing shortcodes to build a store that sells across borders, currency is the layer WooCommerce leaves to you. The Currency Switcher converts prices, takes the payment in the currency the customer selected rather than converting it on their bank statement, and records the exchange rate against each order so refunds and accounts still reconcile months later. A premium licence is £89.00 ex. VAT for a single site, annual, with updates and support included, a 14-day free trial and a 30-day money-back guarantee. See the Aelia Currency Switcher.

Related reading: how to change currency in WooCommerce based on customer location.

WooCommerce Country Codes: Essential Guide for E-commerce Stores

What is a WooCommerce country code? A WooCommerce country code is a two-letter ISO 3166-1 alpha-2 code (for example, US for the United States, GB for the United Kingdom, DE for Germany) that WooCommerce uses to identify billing, shipping and tax locations. WooCommerce ships with all 249 official country codes and updates them with each release.

If you’re running an online store with WooCommerce, you’ve probably encountered country codes. But what exactly are they? Simply put, a country code is a short, standardised abbreviation (usually two letters) that represents a specific country, like US for the United States or GB for Great Britain. WooCommerce uses these codes behind the scenes to identify where your customers are from, which helps it calculate shipping costs, taxes, and even the checkout options that appear during a purchase. These country codes make it easier for your store to handle international orders smoothly without confusion or errors.

WooCommerce is one of the leading e-commerce platforms, loved for its flexibility and powerful features that support selling worldwide. Thanks to the use of country codes, it lets you set up shipping zones, tax rules, and payment methods tailored precisely to different countries and regions. This means you can offer your customers accurate prices and shipping times no matter where they live.

Alongside country codes, WooCommerce also uses state or region codes, which work the same way but at a more detailed level. For example, in the US or Canada, different states or provinces may have different tax rates or shipping rules, and these codes help WooCommerce handle those details properly.

In this guide, you’ll learn everything about WooCommerce country codes: what they are, how to use them, and why they’re so important for running a smooth, professional online store that sells internationally.

What Are WooCommerce Country Codes?

WooCommerce Country Codes

When managing an online store with WooCommerce, country codes play an essential role in organising your sales and shipping across different countries. At their core, country codes are short, standardised abbreviations that represent countries worldwide. WooCommerce uses the internationally recognised ISO 3166-1 alpha-2 standard for these codes, which consists of two capital letters—such as GB for the United Kingdom, FR for France, and DE for Germany.

These codes are more than just labels. WooCommerce relies on them internally to:

  • Identify the country of a customer during checkout
  • Apply the correct shipping zones and rates based on location
  • Calculate taxes accurately according to local laws
  • Tailor payment gateways and currency options for specific countries

Understanding the difference between country codes and state codes is also important. While country codes represent entire nations, state codes (or region codes) refer to subdivisions within those countries. For example, in the United States, US is the country code, while CA stands for California, a state within the US. Similarly, in Canada, CA is the country code, and ON is the code for Ontario. WooCommerce uses both to allow store owners to set precise shipping rules or tax rates that may differ between states, provinces, or regions.

Why Accurate Country Codes Matter

Using accurate country codes is crucial for your store’s smooth operation and customer satisfaction. Here’s why:

  • Shipping Precision: Shipping costs and options often vary from country to country. Correct codes ensure customers see only the relevant shipping methods and prices.
  • Tax Compliance: Different countries—and even regions within countries—have distinct tax laws. Accurate codes help your store apply the right tax rates, avoiding legal complications.
  • Improved User Experience: When country codes are correctly set, customers get tailored checkout options like preferred currencies or local payment gateways, making purchases faster and easier.
  • Avoid Order Errors: Mistakes in country codes can lead to failed orders, incorrect shipping, or delays, which harm your reputation and increase costs.

In short, country codes are the backbone of WooCommerce’s international functionality. Ensuring they are set up properly helps you manage your global store efficiently, keeps customers happy, and keeps your business compliant with different country regulations.

List of Supported WooCommerce Country Codes

WooCommerce supports a comprehensive set of country codes based on the ISO 3166-1 alpha-2 standard. These two-letter codes allow WooCommerce to precisely identify countries for shipping, taxes, and checkout processes. Having a clear, up-to-date list of supported country codes is essential for store owners, especially those selling internationally.

Below is an alphabetised table of WooCommerce-supported country codes and their corresponding countries. This list forms the basis for WooCommerce’s shipping zones, tax calculations, and more.

Full WooCommerce country codes (ISO 3166-1 alpha-2)
Country CodeCountry NameCountry CodeCountry Name
AEUnited Arab EmiratesMDMoldova
AFAfghanistanMEMontenegro
AGAntigua and BarbudaMGMadagascar
AIAnguillaMKNorth Macedonia
ALAlbaniaMLMali
AMArmeniaMMMyanmar
AOAngolaMNMongolia
ARArgentinaMOMacau
ASAmerican SamoaMRMauritania
ATAustriaMSMontserrat
AUAustraliaMTMalta
AWArubaMUMauritius
AXÅland IslandsMVMaldives
AZAzerbaijanMWMalawi
BABosnia and HerzegovinaMXMexico
BBBarbadosMYMalaysia
BDBangladeshMZMozambique
BEBelgiumNANamibia
BFBurkina FasoNCNew Caledonia
BGBulgariaNENiger
BHBahrainNFNorfolk Island
BIBurundiNGNigeria
BJBeninNINicaragua
BLSaint BarthélemyNLNetherlands
BMBermudaNONorway
BNBruneiNPNepal
BOBoliviaNRNauru
BQBonaire, Sint Eustatius, and SabaNUNiue
BRBrazilNZNew Zealand
BSBahamasOMOman
BTBhutanPAPanama
BVBouvet IslandPEPeru
BWBotswanaPFFrench Polynesia
BYBelarusPGPapua New Guinea
BZBelizePHPhilippines
CACanadaPKPakistan
CCCocos (Keeling) IslandsPLPoland
CDDemocratic Republic of the CongoPMSaint Pierre and Miquelon
CFCentral African RepublicPNPitcairn Islands
CGRepublic of the CongoPRPuerto Rico
CHSwitzerlandPSPalestinian Territories
CICôte d’IvoirePTPortugal
CKCook IslandsPWPalau
CLChilePYParaguay
CMCameroonQAQatar
CNChinaRERéunion
COColombiaRORomania
CRCosta RicaRSSerbia
CUCubaRURussia
CVCape VerdeRWRwanda
CWCuraçaoSASaudi Arabia
CXChristmas IslandSBSolomon Islands
CYCyprusSCSeychelles
CZCzech RepublicSDSudan
DEGermanySESweden
DJDjiboutiSGSingapore
DKDenmarkSHSaint Helena
DMDominicaSISlovenia
DODominican RepublicSJSvalbard and Jan Mayen
DZAlgeriaSKSlovakia
ECEcuadorSLSierra Leone
EEEstoniaSMSan Marino
EGEgyptSNSenegal
EHWestern SaharaSOSomalia
EREritreaSRSuriname
ESSpainSSSouth Sudan
ETEthiopiaSTSão Tomé and Príncipe
FIFinlandSVEl Salvador
FJFijiSXSint Maarten
FMMicronesiaSYSyria
FOFaroe IslandsSZEswatini
FRFranceTCTurks and Caicos Islands
GAGabonTDChad
GBUnited KingdomTFFrench Southern Territories
GDGrenadaTGTogo
GEGeorgiaTHThailand
GFFrench GuianaTJTajikistan
GGGuernseyTKTokelau
GHGhanaTLTimor-Leste
GIGibraltarTMTurkmenistan
GLGreenlandTNTunisia
GMGambiaTOTonga
GNGuineaTRTurkey
GPGuadeloupeTTTrinidad and Tobago
GQEquatorial GuineaTVTuvalu
GRGreeceTZTanzania
GTGuatemalaUAUkraine
GUGuamUGUganda
GWGuinea-BissauUMUnited States Minor Outlying Islands
GYGuyanaUSUnited States
HKHong KongUYUruguay
HMHeard Island and McDonald IslandsUZUzbekistan
HNHondurasVAVatican City
HRCroatiaVCSaint Vincent and the Grenadines
HTHaitiVEVenezuela
HUHungaryVGBritish Virgin Islands
IDIndonesiaVIU.S. Virgin Islands
IEIrelandVNVietnam
ILIsraelVUVanuatu
IMIsle of ManWFWallis and Futuna
INIndiaWSSamoa
IOBritish Indian Ocean TerritoryXKKosovo
IQIraqYEYemen
IRIranYTMayotte
ISIcelandZASouth Africa
ITItalyZMZambia
JEJerseyZWZimbabwe
JMJamaica

How Is This List Maintained and Updated?

WooCommerce regularly updates its country code list to stay aligned with the official ISO 3166-1 alpha-2 standard maintained by the International Organization for Standardization (ISO). Changes can happen if countries rename, merge, split, or new territories are recognised. WooCommerce reflects these updates in their codebase through periodic software updates and patches.

For store owners, this means that keeping WooCommerce up to date will usually ensure your country code list remains current without manual intervention.

How to Access This List Within WooCommerce

If you want to see or work directly with the list of country codes WooCommerce supports, you can access it in several ways:

  • Within WooCommerce Plugin Files: The country codes are stored in a PHP file called countries.php inside the WooCommerce plugin folder (typically found at woocommerce/i18n/countries.php). This file contains an array mapping country codes to country names.
  • Through WooCommerce Settings: In your WordPress admin dashboard, go to WooCommerce > Settings > General > Selling Locations or Shipping Zones. When configuring shipping or tax zones, WooCommerce uses this country code list internally to let you choose which countries or regions you want to target.

Programmatically: If you are developing custom code or plugins, WooCommerce provides functions to retrieve the country list, such as:

php
CopyEdit
WC()->countries->get_countries();

  •  This returns an array of all supported countries and their codes.

WooCommerce State Codes and Their Importance

Just as WooCommerce uses country codes to identify nations, it also relies on state codes to represent subdivisions within those countries—such as states, provinces, regions, or territories. These codes follow the ISO 3166-2 standard, which defines codes for the principal subdivisions of all countries coded in ISO 3166-1.

State codes are crucial in WooCommerce for several reasons:

  • Shipping: Many shipping methods and carriers calculate rates based on specific states or provinces rather than just countries. State codes let WooCommerce assign shipping zones more precisely.
  • Tax Calculations: Tax rates often differ between regions within the same country. For example, sales tax in California differs from Texas. WooCommerce uses state codes to apply accurate tax rules.
  • Checkout and Billing: Correct state codes ensure customers see appropriate options and avoid confusion during checkout.
  • Legal Compliance: Some regulations require storing location data at a regional level, making state codes essential.

Because these subdivisions vary widely across countries, WooCommerce allows you to customise or add state codes based on your target markets.

List of WooCommerce State Codes:-

Albanian (AL) states

CodeStateCodeStateCodeState
AL-01BeratAL-02DurrësAL-03Elbasan
AL-04FierAL-05GjirokastërAL-06Korçë
AL-07KukësAL-08LezhëAL-09Dibër
AL-10ShkodërAL-11TiranaAL-12Vlorë

Angolan (AO) States

CodeStateCodeStateCodeState
BGOBengoBLUBenguelaBIEBié
CABCabindaCNNCuneneHUAHuambo
HUIHuílaCCUKuando KubangoCNOKwanza-Norte
CUSKwanza-SulLUALuandaLNOLunda-Norte
LSULunda-SulMALMalanjeMOXMoxico
NAMNamibeUIGUígeZAIZaire

Argentinian (AR) Provinces

CodeStateCodeStateCodeState
CCiudad Autónoma de Buenos AiresBBuenos AiresKCatamarca
HChacoUChubutXCórdoba
WCorrientesEEntre RíosPFormosa
YJujuyLLa PampaFLa Rioja
MMendozaNMisionesQNeuquén
RRío NegroASaltaJSan Juan
DSan LuisZSanta CruzSSanta Fe
GSantiago del EsteroVTierra del FuegoTTucumán

Australian (AU) States

CodeStateCodeState
ACTAustralian Capital TerritoryNSWNew South Wales
NTNorthern TerritoryQLDQueensland
SASouth AustraliaTASTasmania
VICVictoriaWAWestern Australia

Bangladeshi (BD) Districts

CodeStateCodeStateCodeState
BD-05BagerhatBD-01BandarbanBD-02Barguna
BD-06BarishalBD-07BholaBD-03Bogura
BD-04BrahmanbariaBD-09ChandpurBD-10Chattogram
BD-12ChuadangaBD-11Cox’s BazarBD-08Cumilla
BD-13DhakaBD-14DinajpurBD-15Faridpur
BD-16FeniBD-19GaibandhaBD-18Gazipur
BD-17GopalganjBD-20HabiganjBD-21Jamalpur
BD-22JashoreBD-25JhalokatiBD-23Jhenaidah
BD-24JoypurhatBD-29KhagrachhariBD-27Khulna
BD-26KishoreganjBD-28KurigramBD-30Kushtia
BD-31LakshmipurBD-32LalmonirhatBD-36Madaripur
BD-37MaguraBD-33ManikganjBD-39Meherpur
BD-38MoulvibazarBD-35MunshiganjBD-34Mymensingh
BD-48NaogaonBD-43NarailBD-40Narayanganj
BD-42NarsingdiBD-44NatoreBD-45Nawabganj
BD-41NetrakonaBD-46NilphamariBD-47Noakhali
BD-49PabnaBD-52PanchagarhBD-51Patuakhali
BD-50PirojpurBD-53RajbariBD-54Rajshahi
BD-56RangamatiBD-55RangpurBD-58Satkhira
BD-62ShariatpurBD-57SherpurBD-59Sirajganj
BD-61SunamganjBD-60SylhetBD-63Tangail
BD-64Thakurgaon

Bulgarian (BG) States

CodeStateCodeStateCodeState
BG-01BlagoevgradBG-02BurgaBG-08Dobrich
BG-07GabrovoBG-26HaskovoBG-09Kardzhali
BG-10KyustendilBG-11LovechBG-12Montana
BG-13PazardzhikBG-14PernikBG-15Pleven
BG-16PlovdivBG-17RazgradBG-18Ruse
BG-27ShumenBG-19SilistraBG-20Sliven
BG-21SmolyanBG-23SofiaBG-22Sofia-Grad
BG-24Stara ZagoraBG-25TargovishteBG-03Varna
BG-04Veliko TarnovoBG-05VidinBG-06Vratsa
BG-28Yambol

Beninese (BJ) States

CodeStateCodeStateCodeState
ALAliboriAKAtakoraAQAtlantique
BOBorgouCOCollinesKOKouffo
DODongaLILittoralMOMono
OUOuéméPLPlateauZOZou

Bolivian (BO) States

CodeStateCodeStateCodeState
BO-BBeniBO-HChuquisacaBO-CCochabamba
BO-LLa PazBO-OOruroBO-NPando
BO-PPotosíBO-SSanta CruzBO-TTarija

Brazilian (BR) States

CodeStateCodeStateCodeState
ACAcreALAlagoasAPAmapá
AMAmazonasBABahiaCECeará
DFDistrito FederalESEspírito SantoGOGoiás
MAMaranhãoMTMato GrossoMSMato Grosso do Sul
MGMinas GeraisPAParáPBParaíba
PRParanáPEPernambucoPIPiauí
RJRio de JaneiroRNRio Grande do NorteRSRio Grande do Sul
RORondôniaRRRoraimaSCSanta Catarina
SPSão PauloSESergipeTOTocantins

Canadian (CA) Provinces and Territories

CodeProvince/TerritoryCodeProvince/TerritoryCodeProvince/Territory
ABAlbertaBCBritish ColumbiaMBManitoba
NBNew BrunswickNLNewfoundland and LabradorNTNorthwest Territories
NSNova ScotiaNUNunavutONOntario
PEPrince Edward IslandQCQuebecSKSaskatchewan
YTYukon Territory

Algerian (DZ) States

CodeStateCodeStateCodeState
DZ-01AdrarDZ-02ChlefDZ-03Laghouat
DZ-04Oum El BouaghiDZ-05BatnaDZ-06Béjaïa
DZ-07BiskraDZ-08BécharDZ-09Blida
DZ-10BouiraDZ-11TamanghassetDZ-12Tébessa
DZ-13TlemcenDZ-14TiaretDZ-15Tizi Ouzou
DZ-16AlgiersDZ-17DjelfaDZ-18Jijel
DZ-19SétifDZ-20SaïdaDZ-21Skikda
DZ-22Sidi Bel AbbèsDZ-23AnnabaDZ-24Guelma
DZ-25ConstantineDZ-26MédéaDZ-27Mostaganem
DZ-28M’SilaDZ-29MascaraDZ-30Ouargla
DZ-31OranDZ-32El BayadhDZ-33Illizi
DZ-34Bordj Bou ArréridjDZ-35BoumerdèsDZ-36El Tarf
DZ-37TindoufDZ-38TissemsiltDZ-39El Oued
DZ-40KhenchelaDZ-41Souk AhrasDZ-42Tipasa
DZ-43MilaDZ-44Aïn DeflaDZ-45Naama
DZ-46Aïn TémouchentDZ-47GhardaïaDZ-48Relizane

Ecuadorian (EC) States

CodeStateCodeStateCodeState
EC-AAzuayEC-BBolívarEC-FCañar
EC-CCarchiEC-HChimborazoEC-XCotopaxi
EC-OEl OroEC-EEsmeraldasEC-WGalápagos
EC-GGuayasEC-IImbaburaEC-LLoja
EC-RLos RíosEC-MManabíEC-SMorona-Santiago
EC-NNapoEC-DOrellanaEC-YPastaza
EC-PPichinchaEC-SESanta ElenaEC-SDSanto Domingo de los Tsáchilas
EC-USucumbíosEC-TTungurahuaEC-ZZamora-Chinchipe

Egyptian (EG) States

CodeStateCodeStateCodeState
EGALXAlexandriaEGASNAswanEGASTAsyut
EGBARed SeaEGBHBeheiraEGBNSBeni Suef
EGCCairoEGDKDakahliaEGDTDamietta
EGFYMFaiyumEGGHGharbiaEGGZGiza
EGISIsmailiaEGJSSouth SinaiEGKBQalyubia
EGKFSKafr el-SheikhEGKNQenaEGLXLuxor
EGMNMinyaEGMNFMonufiaEGMTMatrouh
EGPTSPort SaidEGSHGSohagEGSHRAl Sharqia
EGSINNorth SinaiEGSUZSuezEGWADNew Valley

Spanish (ES) States

CodeStateCodeStateCodeState
CA CoruñaVIAraba/ÁlavaABAlbacete
AAlicanteALAlmeríaOAsturias
AVÁvilaBABadajozPMBaleares
BBarcelonaBUBurgosCCCáceres
CACádizSCantabriaCSCastellón
CECeutaCRCiudad RealCOCórdoba
CUCuencaGIGironaGRGranada
GUGuadalajaraSSGipuzkoaHHuelva
HUHuescaJJaénLOLa Rioja
GCLas PalmasLELeónLLleida
LULugoMMadridMAMálaga
MLMelillaMUMurciaNANavarra
OROurensePPalenciaPOPontevedra
SASalamancaTFSanta Cruz de TenerifeSGSegovia
SESevillaSOSoriaTTarragona
TETeruelTOToledoVValencia
VAValladolidBIBiscayZAZamora
ZZaragoza

Ghanaian (GH) Regions

CodeStateCodeStateCodeState
AFAhafoAHAshantiBABrong-Ahafo
BOBonoBEBono EastCPCentral
EPEasternAAGreater AccraNENorth East
NPNorthernOTOtiSVSavannah
UEUpper EastUWUpper WestTVVolta
WPWesternWNWestern North

Greek (GR) Regions

CodeStateCodeStateCodeState
IAtticaAEast Macedonia and ThraceBCentral Macedonia
CWest MacedoniaDEpirusEThessaly
FIonian IslandsGWest GreeceHCentral Greece
JPeloponneseKNorth AegeanLSouth Aegean
MCrete

Guatemalan (GT) States

CodeStateCodeStateCodeState
GT-AVAlta VerapazGT-BVBaja VerapazGT-CMChimaltenango
GT-CQChiquimulaGT-PREl ProgresoGT-ESEscuintla
GT-GUGuatemalaGT-HUHuehuetenangoGT-IZIzabal
GT-JAJalapaGT-JUJutiapaGT-PEPetén
GT-QZQuetzaltenangoGT-QCQuichéGT-RERetalhuleu
GT-SASacatepéquezGT-SMSan MarcosGT-SRSanta Rosa
GT-SOSololáGT-SUSuchitepéquezGT-TOTotonicapán
GT-ZAZacapa

Hong Kong (HK) States

CodeStateCodeStateCodeState
HONG KONGHong Kong IslandKOWLOONKowloonNEW TERRITORIESNew Territories

Honduran (HN) States

CodeStateCodeStateCodeState
HN-ATAtlántidaHN-IBBay IslandsHN-CHCholuteca
HN-CLColónHN-CMComayaguaHN-CPCopán
HN-CRCortésHN-EPEl ParaísoHN-FMFrancisco Morazán
HN-GDGracias a DiosHN-INIntibucáHN-LELempira
HN-LPLa PazHN-OCOcotepequeHN-OLOlancho
HN-SBSanta BárbaraHN-VAValleHN-YOYoro

Hungarian (HU) States

CodeStateCodeStateCodeState
BKBács-KiskunBEBékésBABaranya
BZBorsod-Abaúj-ZemplénBUBudapestCSCsongrád-Csanád
FEFejérGSGyőr-Moson-SopronHBHajdú-Bihar
HEHevesJNJász-Nagykun-SzolnokKEKomárom-Esztergom
NONógrádPEPestSOSomogy
SZSzabolcs-Szatmár-BeregTOTolnaVAVas
VEVeszprémZAZala

Indonesian (ID) Provinces

CodeStateCodeStateCodeState
ACDaerah Istimewa AcehSUSumatera UtaraSBSumatera Barat
RIRiauKRKepulauan RiauJAJambi
SSSumatera SelatanBBBangka BelitungBEBengkulu
LALampungJKDKI JakartaJBJawa Barat
BTBantenJTJawa TengahJIJawa Timur
YODaerah Istimewa YogyakartaBABaliNBNusa Tenggara Barat
NTNusa Tenggara TimurKBKalimantan BaratKTKalimantan Tengah
KIKalimantan TimurKSKalimantan SelatanKUKalimantan Utara
SASulawesi UtaraSTSulawesi TengahSGSulawesi Tenggara
SRSulawesi BaratSNSulawesi SelatanGOGorontalo
MAMalukuMUMaluku UtaraPAPapua
PBPapua Barat

Irish (IE) States

CodeStateCodeStateCodeState
CWCarlowCNCavanCEClare
COCorkDLDonegalDDublin
GGalwayKYKerryKEKildare
KKKilkennyLSLaoisLMLeitrim
LKLimerickLDLongfordLHLouth
MOMayoMHMeathMNMonaghan
OYOffalyRNRoscommonSOSligo
TATipperaryWDWaterfordWHWestmeath
WXWexfordWWWicklow

Indian (IN) States

CodeStateCodeStateCodeState
APAndhra PradeshARArunachal PradeshASAssam
BRBiharCTChhattisgarhGAGoa
GJGujaratHRHaryanaHPHimachal Pradesh
JKJammu and KashmirJHJharkhandKAKarnataka
KLKeralaLALadakhMPMadhya Pradesh
MHMaharashtraMNManipurMLMeghalaya
MZMizoramNLNagalandOROdisha
PBPunjabRJRajasthanSKSikkim
TNTamil NaduTSTelanganaTRTripura
UKUttarakhandUPUttar PradeshWBWest Bengal
ANAndaman and Nicobar IslandsCHChandigarhDNDadra and Nagar Haveli
DDDaman and DiuDLDelhiLDLakshadeep
PYPuducherry

Iranian (IR) States

CodeStateCodeStateCodeState
KHZKhuzestan (خوزستان)THRTehran (تهران)ILMIlaam (ایلام)
BHRBushehr (بوشهر)ADLArdabil (اردبیل)ESFIsfahan (اصفهان)
YZDYazd (یزد)KRHKermanshah (کرمانشاه)KRNKerman (کرمان)
HDNHamadan (همدان)GZNGhazvin (قزوین)ZJNZanjan (زنجان)
LRSLuristan (لرستان)ABZAlborz (البرز)EAZEast Azarbaijan (آذربایجان شرقی)
WAZWest Azarbaijan (آذربایجان غربی)CHBChaharmahal and Bakhtiari (چهارمحال و بختیاری)SKHSouth Khorasan (خراسان جنوبی)
RKHRazavi Khorasan (خراسان رضوی)NKHNorth Khorasan (خراسان شمالی)SMNSemnan (سمنان)
FRSFars (فارس)QHMQom (قم)KRDKurdistan / کردستان)
KBDKohgiluyeh and BoyerAhmad (کهگیلوییه و بویراحمد)GLSGolestan (گلستان)GILGilan (گیلان)
MZNMazandaran (مازندران)MKZMarkazi (مرکزی)HRZHormozgan (هرمزگان)
SBNSistan and Baluchestan (سیستان و بلوچستان)

Italian (IT) Provinces

CodeStateCodeStateCodeState
AGAgrigentoALAlessandriaANAncona
AOAostaARArezzoAPAscoli Piceno
ATAstiAVAvellinoBABari
BTBarletta-Andria-TraniBLBellunoBNBenevento
BGBergamoBIBiellaBOBologna
BZBolzanoBSBresciaBRBrindisi
CACagliariCLCaltanissettaCBCampobasso
CECasertaCTCataniaCZCatanzaro
CHChietiCOComoCSCosenza
CRCremonaKRCrotoneCNCuneo
ENEnnaFMFermoFEFerrara
FIFirenzeFGFoggiaFCForlì-Cesena
FRFrosinoneGEGenovaGOGorizia
GRGrossetoIMImperiaISIsernia
SPLa SpeziaAQL’AquilaLTLatina
LELecceLCLeccoLILivorno
LOLodiLULuccaMCMacerata
MNMantovaMSMassa-CarraraMTMatera
MEMessinaMIMilanoMOModena
MBMonza e della BrianzaNANapoliNONovara
NUNuoroOROristanoPDPadova
PAPalermoPRParmaPVPavia
PGPerugiaPUPesaro e UrbinoPEPescara
PCPiacenzaPIPisaPTPistoia
PNPordenonePZPotenzaPOPrato
RGRagusaRARavennaRCReggio Calabria
REReggio EmiliaRIRietiRNRimini
RMRomaRORovigoSASalerno
SSSassariSVSavonaSISiena
SRSiracusaSOSondrioSUSud Sardegna
TATarantoTETeramoTRTerni
TOTorinoTPTrapaniTNTrento
TVTrevisoTSTriesteUDUdine
VAVareseVEVeneziaVBVerbano-Cusio-Ossola
VCVercelliVRVeronaVVVibo Valentia
VIVicenzaVTViterbo

Amaican (JM) parishes

CodeStateCodeStateCodeState
JM-01KingstonJM-02Saint AndrewJM-03Saint Thomas
JM-04PortlandJM-05Saint MaryJM-06Saint Ann
JM-07TrelawnyJM-08Saint JamesJM-09Hanover
JM-10WestmorelandJM-11Saint ElizabethJM-12Manchester
JM-13ClarendonJM-14Saint Catherine

Japanese (JP) prefectures

CodeStateCodeStateCodeState
JP01HokkaidoJP02AomoriJP03Iwate
JP04MiyagiJP05AkitaJP06Yamagata
JP07FukushimaJP08IbarakiJP09Tochigi
JP10GunmaJP11SaitamaJP12Chiba
JP13TokyoJP14KanagawaJP15Niigata
JP16ToyamaJP17IshikawaJP18Fukui
JP19YamanashiJP20NaganoJP21Gifu
JP22ShizuokaJP23AichiJP24Mie
JP25ShigaJP26KyotoJP27Osaka
JP28HyogoJP29NaraJP30Wakayama
JP31TottoriJP32ShimaneJP33Okayama
JP34HiroshimaJP35YamaguchiJP36Tokushima
JP37KagawaJP38EhimeJP39Kochi
JP40FukuokaJP41SagaJP42Nagasaki
JP43KumamotoJP44OitaJP45Miyazaki
JP46KagoshimaJP47Okinawa

Kenyan (KE) counties

CodeStateCodeStateCodeState
KE01BaringoKE02BometKE03Bungoma
KE04BusiaKE05Elgeyo-MarakwetKE06Embu
KE07GarissaKE08Homa BayKE09Isiolo
KE10KajiadoKE11KakamegaKE12Kericho
KE13KiambuKE14KilifiKE15Kirinyaga
KE16KisiiKE17KisumuKE18Kitui
KE19KwaleKE20LaikipiaKE21Lamu
KE22MachakosKE23MakueniKE24Mandera
KE25MarsabitKE26MeruKE27Migori
KE28MombasaKE29Murang’aKE30Nairobi County
KE31NakuruKE32NandiKE33Narok
KE34NyamiraKE35NyandaruaKE36Nyeri
KE37SamburuKE38SiayaKE39Taita-Taveta
KE40Tana RiverKE41Tharaka-NithiKE42Trans Nzoia
KE43TurkanaKE44Uasin GishuKE45Vihiga
KE46WajirKE47West Pokot

Laotian (LA) provinces

CodeStateCodeStateCodeState
ATAttapeuBKBokeoBLBolikhamsai
CHChampasakHOHouaphanhKHKhammouane
LMLuang NamthaLPLuang PrabangOUOudomxay
PHPhongsalySLSalavanSVSavannakhet
VIVientiane ProvinceVTVientianeXASainyabuli
XESekongXIXiangkhouangXSXaisomboun

Liberian (LR) provinces

CodeStateCodeStateCodeState
BMBomiBNBongGAGbarpolu
GBGrand BassaGCGrand Cape MountGGGrand Gedeh
GKGrand KruLOLofaMAMargibi
MYMarylandMOMontserradoNMNimba
RVRivercessRGRiver GeeSNSinoe

Moldovan (MD) states

CodeStateCodeStateCodeState
CChișinăuBLBălțiANAnenii Noi
BSBasarabeascaBRBriceniCHCahul
CTCantemirCLCălărașiCSCăușeni
CMCimișliaCRCriuleniDNDondușeni
DRDrochiaDBDubăsariEDEdineț
FLFăleștiFRFloreștiGEUTA Găgăuzia
GLGlodeniHNHînceștiILIaloveni
TLTeleneștiUNUngheni

Mexican (MX) states

CodeStateCodeStateCodeState
DFCiudad de MéxicoJAJaliscoNLNuevo León
AGAguascalientesBCBaja CaliforniaBSBaja California Sur
CMCampecheCSChiapasCHChihuahua
COCoahuilaCLColimaDGDurango
GTGuanajuatoGRGuerreroHGHidalgo
MXEstado de MéxicoMIMichoacánMOMorelos
NANayaritOAOaxacaPUPuebla
QTQuerétaroQRQuintana RooSLSan Luis Potosí
SISinaloaSOSonoraTBTabasco
TMTamaulipasTLTlaxcalaVEVeracruz
YUYucatánZAZacatecas

Malaysian (MY) states

CodeStateCodeStateCodeState
JHRJohorKDHKedahKTNKelantan
LBNLabuanMLKMalacca (Melaka)NSNNegeri Sembilan
PHGPahangPNGPenang (Pulau Pinang)PRKPerak
PLSPerlisSBHSabahSWKSarawak
SGRSelangorTRGTerengganuPJYPutrajaya
KULKuala Lumpur

Mozambican (MZ) provinces

CodeStateCodeStateCodeState
MZPCabo DelgadoMZGGazaMZIInhambane
MZBManicaMZLMaputo ProvinceMZMPMMaputo
MZNNampulaMZANiassaMZSSofala
MZTTeteMZQZambézia

Namibian (NA) regions

CodeStateCodeStateCodeState
ERErongoHAHardapKAKaras
KEKavango EastKWKavango WestKHKhomas
KUKuneneOWOhangwenaOHOmaheke
OSOmusatiONOshanaOTOshikoto
ODOtjozondjupaCAZambezi

Nigerian (NG) provinces

CodeStateCodeStateCodeState
ABAbiaFCAbujaADAdamawa
AKAkwa IbomANAnambraBABauchi
BYBayelsaBEBenueBOBorno
CRCross RiverDEDeltaEBEbonyi
EDEdoEKEkitiENEnugu
GOGombeIMImoJIJigawa
KDKadunaKNKanoKTKatsina
KEKebbiKOKogiKWKwara
LALagosNANasarawaNINiger
OGOgunONOndoOSOsun
OYOyoPLPlateauRIRivers
SOSokotoTATarabaYOYobe
ZAZamfara

Nepalese (NP) zones

CodeStateCodeStateCodeState
BAGBagmatiBHEBheriDHADhaulagiri
GANGandakiJANJanakpurKARKarnali
KOSKoshiLUMLumbiniMAHMahakali
MECMechiNARNarayaniRAPRapti
SAGSagarmathaSETSeti

Nicaraguan (NI) states

CodeStateCodeStateCodeState
NI-ANAtlántico NorteNI-ASAtlántico SurNI-BOBoaco
NI-CACarazoNI-CIChinandegaNI-COChontales
NI-ESEstelíNI-GRGranadaNI-JIJinotega
NI-LELeónNI-MDMadrizNI-MNManagua
NI-MSMasayaNI-MTMatagalpaNI-NSNueva Segovia
NI-RIRivasNI-SJRío San Juan

New Zealand (NZ) states

CodeStateCodeStateCodeState
NLNorthlandAKAucklandWAWaikato
BPBay of PlentyTKTaranakiGIGisborne
HBHawke’s BayMWManawatu-WanganuiWEWellington
NSNelsonMBMarlboroughTMTasman
WCWest CoastCTCanterburyOTOtago
SLSouthland

Panamanian (PA) states

CodeStateCodeStateCodeState
PA-1Bocas del ToroPA-2CocléPA-3Colón
PA-4ChiriquíPA-5DariénPA-6Herrera
PA-7Los SantosPA-8PanamáPA-9Veraguas
PA-10West PanamáPA-EMEmberáPA-KYGuna Yala
PA-NBNgöbe-Buglé

Peruvian (PE) states

CodeStateCodeStateCodeState
CALEl CallaoLMAMunicipalidad Metropolitana de LimaAMAAmazonas
ANCAncashAPUApurímacAREArequipa
AYAAyacuchoCAJCajamarcaCUSCusco
HUVHuancavelicaHUCHuánucoICAIca
JUNJunínLALLa LibertadLAMLambayeque
LIMLimaLORLoretoMDDMadre de Dios
MOQMoqueguaPASPascoPIUPiura
PUNPunoSAMSan MartínTACTacna
TUMTumbesUCAUcayali

Philippine (PH) provinces

CodeStateCodeStateCodeState
ABRAbraAGNAgusan del NorteAGSAgusan del Sur
AKLAklanALBAlbayANTAntique
APAApayaoAURAuroraBASBasilan
BANBataanBTNBatanesBTGBatangas
BENBenguetBILBiliranBOHBohol
BUKBukidnonBULBulacanCAGCagayan
CANCamarines NorteCASCamarines SurCAMCamiguin
CAPCapizCATCatanduanesCAVCavite
CEBCebuCOMCompostela ValleyNCOCotabato
DAVDavao del NorteDASDavao del SurDACDavao Occidental
DAODavao OrientalDINDinagat IslandsEASEastern Samar
GUIGuimarasIFUIfugaoILNIlocos Norte
ILSIlocos SurILIIloiloISAIsabela
KALKalingaLUNLa UnionLAGLaguna
LANLanao del NorteLASLanao del SurLEYLeyte
MAGMaguindanaoMADMarinduqueMASMasbate
MSCMisamis OccidentalMSRMisamis OrientalMOUMountain Province
NECNegros OccidentalNERNegros OrientalNSANorthern Samar
NUENueva EcijaNUVNueva VizcayaMDCOccidental Mindoro
MDROriental MindoroPLWPalawanPAMPampanga
PANPangasinanQUEQuezonQUIQuirino
RIZRizalROMRomblonWSASamar
SARSaranganiSIQSiquijorSORSorsogon
SCOSouth CotabatoSLESouthern LeyteSUKSultan Kudarat
SLUSuluSUNSurigao del NorteSURSurigao del Sur
TARTarlacTAWTawi-TawiZMBZambales
ZANZamboanga del NorteZASZamboanga del SurZSIZamboanga Sibugay
00Metro Manila

Pakistani (PK) states

CodeStateCodeStateCodeState
JKAzad KashmirBABalochistanTAFATA
GBGilgit BaltistanISIslamabad Capital TerritoryKPKhyber Pakhtunkhwa
PBPunjabSDSindh

Paraguayan (PY) states

CodeStateCodeStateCodeState
PY-ASUAsunciónPY-1ConcepciónPY-2San Pedro
PY-3PY-4GuairáPY-5Caaguazú
PY-6CaazapáPY-7ItapúaPY-8Misiones
PY-9ParaguaríPY-10Alto ParanáPY-11Central
PY-12ÑeembucúPY-13AmambayPY-14Canindeyú
PY-15Presidente HayesPY-16Alto ParaguayPY-17Boquerón

Romanian (RO) states

CodeStateCodeStateCodeState
ABAlbaARAradAGArgeș
BCBacăuBHBihorBNBistrița-Năsăud
BTBotoșaniBRBrăilaBVBrașov
BBucureștiBZBuzăuCLCălărași
CSCaraș-SeverinCJClujCTConstanța
CVCovasnaDBDâmbovițaDJDolj
GLGalațiGRGiurgiuGJGorj
HRHarghitaHDHunedoaraILIalomița
ISIașiIFIlfovMMMaramureș
MHMehedințiMSMureșNTNeamț
OTOltPHPrahovaSJSălaj
SMSatu MareSBSibiuSVSuceava
TRTeleormanTMTimișTLTulcea
VLVâlceaVSVasluiVNVrancea

Salvadoran (SV) states

CodeStateCodeStateCodeState
SV-AHAhuachapánSV-CACabañasSV-CHChalatenango
SV-CUCuscatlánSV-LILa LibertadSV-MOMorazán
SV-PALa PazSV-SASanta AnaSV-SMSan Miguel
SV-SOSonsonateSV-SSSan SalvadorSV-SVSan Vicente
SV-UNLa UniónSV-USUsulután

Thai (TH) states

CodeStateCodeStateCodeState
TH-37Amnat CharoenTH-15Ang ThongTH-14Ayutthaya
TH-10BangkokTH-38Bueng KanTH-31Buri Ram
TH-24ChachoengsaoTH-18Chai NatTH-36Chaiyaphum
TH-22ChanthaburiTH-50Chiang MaiTH-57Chiang Rai
TH-20ChonburiTH-86ChumphonTH-46Kalasin
TH-62Kamphaeng PhetTH-71KanchanaburiTH-40Khon Kaen
TH-81KrabiTH-52LampangTH-51Lamphun
TH-42LoeiTH-16LopburiTH-58Mae Hong Son
TH-44Maha SarakhamTH-49MukdahanTH-26Nakhon Nayok
TH-73Nakhon PathomTH-48Nakhon PhanomTH-30Nakhon Ratchasima
TH-60Nakhon SawanTH-80Nakhon Si ThammaratTH-55Nan
TH-96NarathiwatTH-39Nong Bua Lam PhuTH-43Nong Khai
TH-12NonthaburiTH-13Pathum ThaniTH-94Pattani
TH-82Phang NgaTH-93PhatthalungTH-56Phayao
TH-67PhetchabunTH-76PhetchaburiTH-66Phichit
TH-65PhitsanulokTH-54PhraeTH-83Phuket
TH-25Prachin BuriTH-77Prachuap Khiri KhanTH-85Ranong
TH-70RatchaburiTH-21RayongTH-45Roi Et
TH-27Sa KaeoTH-47Sakon NakhonTH-11Samut Prakan
TH-74Samut SakhonTH-75Samut SongkhramTH-19Saraburi
TH-91SatunTH-17Sing BuriTH-33Sisaket
TH-90SongkhlaTH-64SukhothaiTH-72Suphan Buri
TH-84Surat ThaniTH-32SurinTH-63Tak
TH-92TrangTH-23TratTH-34Ubon Ratchathani
TH-41Udon ThaniTH-61Uthai ThaniTH-53Uttaradit
TH-95YalaTH-35Yasothon

Turkish (TR) states

CodeStateCodeStateCodeState
TR01AdanaTR02AdıyamanTR03Afyon
TR04AğrıTR05AmasyaTR06Ankara
TR07AntalyaTR08ArtvinTR09Aydın
TR10BalıkesirTR11BilecikTR12Bingöl
TR13BitlisTR14BoluTR15Burdur
TR16BursaTR17ÇanakkaleTR18Çankırı
TR19ÇorumTR20DenizliTR21Diyarbakır
TR22EdirneTR23ElazığTR24Erzincan
TR25ErzurumTR26EskişehirTR27Gaziantep
TR28GiresunTR29GümüşhaneTR30Hakkari
TR31HatayTR32IspartaTR33İçel
TR34İstanbulTR35İzmirTR36Kars
TR37KastamonuTR38KayseriTR39Kırklareli
TR40KırşehirTR41KocaeliTR42Konya
TR43KütahyaTR44MalatyaTR45Manisa
TR46KahramanmaraşTR47MardinTR48Muğla
TR49MuşTR50NevşehirTR51Niğde
TR52OrduTR53RizeTR54Sakarya
TR55SamsunTR56SiirtTR57Sinop
TR58SivasTR59TekirdağTR60Tokat
TR61TrabzonTR62TunceliTR63Şanlıurfa
TR64UşakTR65VanTR66Yozgat
TR67ZonguldakTR68AksarayTR69Bayburt
TR70KaramanTR71KırıkkaleTR72Batman
TR73ŞırnakTR74BartınTR75Ardahan
TR76IğdırTR77YalovaTR78Karabük
TR79KilisTR80OsmaniyeTR81Düzce

Tanzanian (TZ) states

CodeStateCodeStateCodeState
TZ01ArushaTZ02Dar es SalaamTZ03Dodoma
TZ04IringaTZ05KageraTZ06Pemba North
TZ07Zanzibar NorthTZ08KigomaTZ09Kilimanjaro
TZ10Pemba SouthTZ11Zanzibar SouthTZ12Lindi
TZ13MaraTZ14MbeyaTZ15Zanzibar West
TZ16MorogoroTZ17MtwaraTZ18Mwanza
TZ19CoastTZ20RukwaTZ21Ruvuma
TZ22ShinyangaTZ23SingidaTZ24Tabora
TZ25TangaTZ26ManyaraTZ27Geita
TZ28KataviTZ29NjombeTZ30Simiyu

Serbian (RS) districts

CodeStateCodeStateCodeState
RS00BelgradeRS14BorRS11Braničevo
RS02Central BanatRS10DanubeRS23Jablanica
RS09KolubaraRS08MačvaRS17Morava
RS20NišavaRS01North BačkaRS03North Banat
RS24PčinjaRS22PirotRS13Pomoravlje
RS19RasinaRS18RaškaRS06South Bačka
RS04South BanatRS07SremRS12Šumadija
RS21ToplicaRS05West BačkaRS15Zaječar
RS16ZlatiborRS25KosovoRS26Peć
RS27PrizrenRS28Kosovska MitrovicaRS29Kosovo-Pomoravlje
RSKMKosovo-MetohijaRSVOVojvodina

Ukrainian (UA) oblasts

CodeStateCodeStateCodeState
VNVinnytsia OblastVLVolyn OblastDPDnipropetrovsk Oblast
DTDonetsk OblastZTZhytomyr OblastZKZakarpattia Oblast
ZPZaporizhzhia OblastIFIvano-Frankivsk OblastKVKyiv Oblast
KHKirovohrad OblastLHLuhansk OblastLVLviv Oblast
MYMykolaiv OblastODOdessa OblastPLPoltava Oblast
RVRivne OblastSMSumy OblastTPTernopil Oblast
KKKharkiv OblastKSKherson OblastKMKhmelnytskyi Oblast
CKCherkasy OblastCHChernihiv OblastCVChernivtsi Oblast

Ugandan (UG) districts

CodeStateCodeStateCodeState
UG314AbimUG301AdjumaniUG322Agago
UG323AlebtongUG315AmolatarUG324Amudat
UG216AmuriaUG316AmuruUG302Apac
UG303AruaUG217BudakaUG218Bududa
UG201BugiriUG235BugweriUG420Buhweju
UG117BuikweUG219BukedeaUG118Bukomansimbi
UG220BukwaUG225BulambuliUG416Buliisa
UG401BundibugyoUG430BunyangabuUG402Bushenyi
UG202BusiaUG221ButalejaUG119Butambala
UG233ButeboUG120BuvumaUG226Buyende
UG317DokoloUG121GombaUG304Gulu
UG403HoimaUG417IbandaUG203Iganga
UG418IsingiroUG204JinjaUG318Kaabong
UG404KabaleUG405KabaroleUG213Kaberamaido
UG427KagadiUG428KakumiroUG101Kalangala
UG222KaliroUG122KalunguUG102Kampala
UG205KamuliUG413KamwengeUG414Kanungu
UG206KapchorwaUG236KapelebyongUG126Kasanda
UG406KaseseUG207KatakwiUG112Kayunga
UG407KibaaleUG103KibogaUG227Kibuku
UG432KikuubeUG419KiruhuraUG421Kiryandongo
UG408KisoroUG305KitgumUG319Koboko
UG325KoleUG306KotidoUG208Kumi
UG333KwaniaUG228KweenUG123Kyankwanzi
UG422KyegegwaUG415KyenjojoUG125Kyotera
UG326LamwoUG307LiraUG229Luuka
UG104LuweroUG124LwengoUG114Lyantonde
UG223ManafwaUG320MarachaUG105Masaka
UG409MasindiUG214MayugeUG209Mbale
UG410MbararaUG423MitoomaUG115Mityana
UG308MorotoUG309MoyoUG106Mpigi
UG107MubendeUG108MukonoUG334Nabilatuk
UG311NakapiripiritUG116NakasekeUG109Nakasongola
UG230NamayingoUG234NamisindwaUG224Namutumba
UG327NapakUG310NebbiUG231Ngora
UG424NtorokoUG411NtungamoUG328Nwoya
UG331OmoroUG329OtukeUG321Oyam
UG312PaderUG332PakwachUG210Pallisa
UG110RakaiUG429RubandaUG425Rubirizi
UG431RukigaUG412RukungiriUG111Sembabule
UG232SerereUG426SheemaUG215Sironko
UG211SorotiUG212TororoUG113Wakiso
UG313YumbeUG330Zombo

United States Minor Outlying Islands (UM)

CodeStateCodeStateCodeState
81Baker Island84Howland Island86Jarvis Island
67Johnston Atoll89Kingman Reef71Midway Atoll
76Navassa Island95Palmyra Atoll79Wake Island

United States (US) states

CodeStateCodeStateCodeState
ALAlabamaAKAlaskaAZArizona
ARArkansasCACaliforniaCOColorado
CTConnecticutDEDelawareDCDistrict Of Columbia
FLFloridaGAGeorgiaHIHawaii
IDIdahoILIllinoisINIndiana
IAIowaKSKansasKYKentucky
LALouisianaMEMaineMDMaryland
MAMassachusettsMIMichiganMNMinnesota
MSMississippiMOMissouriMTMontana
NENebraskaNVNevadaNHNew Hampshire
NJNew JerseyNMNew MexicoNYNew York
NCNorth CarolinaNDNorth DakotaOHOhio
OKOklahomaOROregonPAPennsylvania
RIRhode IslandSCSouth CarolinaSDSouth Dakota
TNTennesseeTXTexasUTUtah
VTVermontVAVirginiaWAWashington
WVWest VirginiaWIWisconsinWYWyoming
AAArmed Forces (AA)AEArmed Forces (AE)APArmed Forces (AP)

Uruguayan (UY) states

CodeStateCodeStateCodeState
UY-ARArtigasUY-CACanelonesUY-CLCerro Largo
UY-COColoniaUY-DUDuraznoUY-FSFlores
UY-FDFloridaUY-LALavallejaUY-MAMaldonado
UY-MOMontevideoUY-PAPaysandúUY-RNRío Negro
UY-RVRiveraUY-RORochaUY-SASalto
UY-SJSan JoséUY-SOSorianoUY-TATacuarembó
UY-TTTreinta y Tres

Venezuelan (VE) states

CodeStateCodeStateCodeState
VE-ACapitalVE-BAnzoáteguiVE-CApure
VE-DAraguaVE-EBarinasVE-FBolívar
VE-GCaraboboVE-HCojedesVE-IFalcón
VE-JGuáricoVE-KLaraVE-LMérida
VE-MMirandaVE-NMonagasVE-ONueva Esparta
VE-PPortuguesaVE-RSucreVE-STáchira
VE-TTrujilloVE-UYaracuyVE-VZulia
VE-WFederal DependenciesVE-XLa Guaira (Vargas)VE-YDelta Amacuro
VE-ZAmazonas

South African (ZA) states

CodeStateCodeStateCodeState
ECEastern CapeFSFree StateGPGauteng
KZNKwaZulu-NatalLPLimpopoMPMpumalanga
NCNorthern CapeNWNorth WestWCWestern Cape

Zambian (ZM) provinces

CodeStateCodeStateCodeState
ZM-01WesternZM-02CentralZM-03Eastern
ZM-04LuapulaZM-05NorthernZM-06North-Western
ZM-07SouthernZM-08CopperbeltZM-09Lusaka
ZM-10Muchinga

How to Use WooCommerce Country Codes in Your Store

When customers visit your WooCommerce store and proceed to checkout, the default country and state must be set correctly to provide a smooth experience.

By default, WooCommerce uses your store address to guess the customer’s location. However, you can explicitly set the default country and state to match your primary market or most frequent customer base. This helps reduce friction and speeds up the checkout process.

How to set it:

  1. Go to your WordPress admin dashboard.
  2. Navigate to WooCommerce > Settings > General.
  3. Find the Selling location(s) and Default customer location options.
  4. Under Default customer location, select Specific country, and pick the country using the two-letter ISO country code (e.g., US for the United States, CA for Canada).
  5. To set the default state, you may need to add a small snippet of code or use a plugin that allows setting default states by country codes.

Using the correct country and state codes ensures the checkout fields are pre-filled with the right default values, enhancing the user experience.

Restricting Sales to Specific Countries or States Using Country Codes

If you want to restrict where you sell or ship products, WooCommerce allows you to limit sales to specific countries — or even states — using country/state codes.

Why restrict sales?

  • You only want to sell to countries where you can ship.
  • Tax regulations require limiting sales by location.
  • Business strategy dictates regional availability.

How to set it:

  1. Go to WooCommerce > Settings > General.
  2. Under Selling location(s), select Sell to specific countries.
  3. Enter the ISO country codes of the countries you want to sell to, separated by commas (e.g., US,CA,GB).
  4. To restrict by states or provinces, use a plugin or customization that accepts codes like US-NY for New York or CA-ON for Ontario.

Adding Custom Countries or States (Step-by-Step Guide)

Sometimes you may want to add custom countries or states not available in WooCommerce by default — e.g., territories or special regions.

Step 1: Add a custom country

add_filter( 'woocommerce_countries', 'add_custom_country' );

function add_custom_country( $countries )

{

    $countries['XX'] = 'Customland'; // 'XX' = new country code

    return $countries;

<span style="font-weight: 400;">}

Step 2: Add states to that custom country

add_filter( 'woocommerce_states', 'add_custom_country_states' );

function add_custom_country_states( $states ) {

    $states['XX'] = array(

        'XX-01' => 'Custom State 1',

        'XX-02' => 'Custom State 2',

    );

    return $states;

}

Step 3: Use them in WooCommerce settings

Your custom country and states will now show up throughout WooCommerce — including checkout, shipping zones, and tax rules.

Modifying Country or State Names Shown to Users

You can also change how country or state names appear to customers — ideal for localization, branding, or translations.

Rename a country’s display name:

add_filter( 'woocommerce_countries', 'modify_country_names' );

function modify_country_names( $countries ) {

    if ( isset( $countries['US'] ) ) {

        $countries['US'] = 'United States of Awesome';

    }

    return $countries;

}

Rename a state’s display name:

add_filter( 'woocommerce_states', 'modify_state_names' );

function modify_state_names( $states ) {

    if ( isset( $states['US']['CA'] ) ) {

        $states['US']['CA'] = 'California Dreamin\'';

    }

    return $states;

}

Using Country Codes in Shipping & Tax Plugins

Most WooCommerce shipping and tax plugins rely on country and state codes to work properly.

Examples include:

  • Shipping Zones — configured using country/state codes (e.g., US, US-TX).
  • Tax Rules — applied to specific regions using codes for correct tax calculation.
  • Third-Party Plugins: such as the powerful Tax Display by Country for WooCommerce plugin, which displays product prices inclusive/exclusive of tax based on the customer’s country code.

Using official ISO country and state codes ensures compatibility and prevents configuration errors.