How to Add Country Restriction for WooCommerce Products

Recently one of our readers asked if it was possible to restrict countries in your WooCommerce store?

By hiding your WooCommerce store from specific countries, you can control your product visibility around the world. That way, your products will only be available in specific countries.

In this article, we will show you how to easily add country based restriction to WooCommerce products or even your entire WooCommerce store.

How to Restrict Countries in WooCommerce

Why Restrict Your WooCommerce Store in a Country?

When selling products online, an online store owner can come across a lot of problems. For example, you can get a product order from a country where that product is illegal, or your payment gateways can’t process fees.

When building a WooCommerce store, it is important to provide the best user experience to your customers. You don’t want the customer to place an order only to find out that they can’t complete their purchase.

This can result in customer frustration, and it can keep them from ever coming back to your site or buying something else from you.

To avoid these kinds of situations, it is better to restrict access to your WooCommerce store or products from specific countries.

With that being said, let’s take a look at how you easily can restrict your WooCommerce store and products in specific countries.

You can jump to either method by clicking the links below:

Method 1. Restricting Countries Using WooCommerce Settings

You can easily hide your online store in specific countries using WooCommerce default settings.

First, go ahead and click on the WooCommerce » Settings option in your WordPress dashboard and then go to the ‘General’ tab.

Go to WooCommerce Settings and select General

Once there, scroll down to the ‘General Options.’ Here you will find the ‘Selling Location’ section. Simply click on the dropdown menu in the field where you will find three options.

You can either select the ‘Sell to specific countries, except for…’ option, or you can choose the ‘ Sell to specific countries’ option.

Go to General Option and select Selling Location

When you select the ‘Sell to specific countries, except for…’ option, another field will appear.

Now, just select from the dropdown any countries where you don’t want to sell your products.

Select countries where you don't want to sell your product

If you’ve chosen the ‘Sell to specific countries’ option, a ‘Sell to specific countries’ field will appear in the settings below.

Now you can select all the countries where your store will be available.

Select countries where you want to sell your product

This method is very easy to use, and you don’t have to download any additional WooCommerce plugins for it.

The main downside of this method is that you cannot hide specific products.

By restricting countries using the default settings method in WooCommerce, the restrictions will be applied to your whole online store, and users in those countries won’t be able to buy any of your products.

If you only want to hide some specific products in different countries, it is better to use a plugin mentioned in Method 2. Let’s take a look at how to restrict specific WooCommerce products in different countries.

Method 2. Add Country Based Restrictions for WooCommerce Products

The best way to hide your store products in some specific countries is by using a WordPress plugin like the Country Based Restrictions For WooCommerce.

It is a free WooCommerce plugin that allows you to hide your products in specific countries.

First, you’ll need to install and activate the ‘Country Based Restrictions For WooCommerce’ plugin. For more details, please take a look at our guide on how to install a WordPress plugin.

After you’ve activated the plugin, go to Plugins » Installed Plugins.

Go to the country based restrictions for WooCommerce plugin settings

Here, click on the ‘Settings’ link in the ‘Country Based Restrictions for WooCommerce’ entry.

Once you’re on the ‘Settings’ page, just click on the ‘Catalog Visibility’ option.

Choose Catalog Visibility option

After you’ve clicked on the ‘Catalog Visibility’ option, you will have 3 choices:

  • Hide Completely – Restricted products will not appear in your store.
  • Hide Catalog Visibility – Restricted products will only be available by direct links, but not through browsing or search results.
  • Catalog Visible (non purchasable) – Restricted products will appear as normal, but customers will be unable to purchase them.

Once you’ve chosen an option, simply click on the ‘Save Changes’ button.

Choose your Catalog Visibility option

Next, go to WooCommerce » All Products in your WordPress dashboard.

Locate the product that you want to restrict and simply click on the ‘Edit’ link.

Go to WooCommerce Products and select Edit

This will open the ‘Edit Product’ page. You can then scroll down to the ‘Product Data’ section.

Next, simply click on the ‘Country Restrictions’ option to the left.

Go to Product Data section and select Country Restrictions

After you’ve clicked on the ‘Country Restrictions’ option, you’ll see a ‘Restriction Rule’ field.

Simply click on the dropdown menu beside the field and select the ‘Product Not Available For Selected Countries’ option.

Select Product not available for selected countries option

After that, go to the ‘Select Countries’ field and click on the dropdown beside it.

Then, simply choose the countries where your product won’t be available for purchase.

Choose countries you want to restrict

Once you’re happy with your choice, don’t forget to click on the ‘Publish button.’

Now, if a customer from the chosen country visits your store, the product you’ve restricted won’t appear.

Bonus: Geolocation Targeting for WooCommerce to Grow Sales

Did you know that geotargeting in WooCommerce can help you grow sales?

We have created an ultimate guide to geolocation targeting in WordPress that will show you how to create personalized content and offers for users in specific countries using various tools.

For example, you can use a plugin like OptinMonster to run specific discounts for certain locations, offer different prices based on countries, and so much more.

Optinmonster Coupon Popups

We hope this article helped you learn how to restrict countries in your WooCommerce store. You may also want to see our ultimate WooCommerce SEO guide to improve your SEO rankings, or see our tutorial on how to fix WooCommerce not sending email issue to improve your email deliverability.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Country Restriction for WooCommerce Products first appeared on WPBeginner.

Ultimate Guide to Geotargeting in WordPress – Step by Step

Do you want to use Geotargeting in WordPress to enhance the customer experience?

Geotargeting allows website owners to show personalized content to users based on their geographic location. It helps improve user experience and conversion rates for businesses.

In this ultimate guide, we’ll show you how to use Geotargeting in WordPress to boost sales and customer satisfaction.

Using geotargeting in WordPress and WooCommerce

Why Use GeoTargeting in WordPress?

Geotargeting or Geo-Location targeting is a marketing technique that allows businesses to offer custom user experiences based on a customer’s geographic location.

You can use geotargeting to make your content, products, and website more relevant to the customer. Research shows that it helps build user interest, boosts engagement, results in higher conversions, and generate more sales.

A Google study found that 61% of smartphone owners prefer to buy from sites that customize information for their location.

For instance, a real estate website can use geotargeting to show specific real estate listings in a user’s region. Similarly, an online store can offer customers free shipping by detecting their geolocation first.

Having that said, now let’s take a look at some of the easiest ways to use geotargeting effectively in WordPress. Here is a quick overview of what we’ll cover in this guide.

Tracking User Geographic Locations in WordPress

Before you learn how to target users in different geographic locations, you need to gather the data about where your users are coming from.

The easiest way to track user’s geographic locations is by using MonsterInsights. It is the best Google Analytics plugin for WordPress and allows you to easily track website visitors.

MonsterInsights

First thing you need to do is install and activate the MonsterInsights plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, the plugin will automatically guide you to connect your WordPress website to your Google Analytics account. If you need help, then see our step-by-step guide on how to install Google Analytics in WordPress.

After that, you can view your website traffic reports by visiting the Insights » Reports page.

View countries report in MonsterInsights

It will show you a section of the top 10 countries, and you can view more data by clicking on the ‘View Countries Report’ button. This will take you to the Google Analytics website where you will see a full list of countries.

Google Analytics Geolocation report

You can click on each country to see how users from that country used your website, how many pages they viewed, how much time they spent, did they convert, and more.

You can then adjust your strategies to target regions that are not performing so well and find more ways to increase revenues from locations that are doing well.

Using Geotargeting in WordPress and WooCommerce with OptinMonster

The most common use of geotargeting is to show personalized content to your users based on their location.

This is where OptinMonster comes in.

It is the best conversion optimization software in the world because it helps you convert abandoning website visitors into customers and subscribers.

It also comes equipped with incredibly powerful display rules including geotargeting to show targeted messages on your website.

First, you’ll need to sign up for an OptinMonster account.

Note: You’ll need at least their Growth plan to access Goetargeting features.

OptinMonster

After signing up, switch to your WordPress website to install and activate the OptinMonster plugin. For more details, see our step by step guide on how to install a WordPress plugin.

This plugin acts as a connector between your WordPress website and your OptinMonster account.

Upon activation, you need to visit OptinMonster » Settings page and click on the ‘Connect existing account’ button.

Connect OptinMonster account to WordPress

This will bring up a popup where you can log in and connect your WordPress site to your OptinMonster account.

Now that your WordPress site is connected, you are ready to create your first geotargeted campaign. Go to the OptinMonster » Campaigns page and click on the ‘Add New’ button.

Create campaign

First, you’ll need to choose your campaign type. OptinMonster supports lightbox popups, floating bars, inline optins, fullscreen, slide-in, and gamified campaigns.

For the sake of this tutorial, we’ll choose a lightbox popup campaign. Below that, you can select a campaign template by clicking on it.

Select campaign type and template

Next, you need to enter a name for your campaign. You can enter any name here, and then click on the ‘Start building’ button.

Enter campaign name

This will launch OptinMonster’s campaign builder interface with a live preview of your campaign in the right panel.

Editing OptinMonster campaign

You can simply point and click on any item in the preview to edit, move, or delete it. You can also add new elements from the left column.

Let’s add some personalized geotargeted messaging to this campaign. To do that, we will be using an OptinMonster feature called Smart Tag.

Simply click on a text area or add a new text block and then in the text toolbar click on the Smart Tag button.

Detect and show user's location in OptinMonster using Smart Tag

It will show you a list of smart dynamic texts that you can add to your content.

We’ll add {{city}} smart tag to our campaign. This tag will automatically detect user’s city and display it in the campaign content.

Once you are finished editing your campaign, you can switch to the ‘Display Rules’ tab. This is where you can configure when to show your campaign.

Display rules to set up geotargeting campaigns

Next, you need to create a new Ruleset and use Physical location as the condition to check.

After that, you will be asked to select the criteria you want to match. For instance, we want to show this campaign if the visitors’ location is in Florida.

Display criteria for geotargeting

Click on the Validate button to make sure that your condition is setup correctly. After that, click on the Next Step button to continue.

Next, you’ll be asked which campaign view you want to show and if you want to use special effects.

Campaign display settings

Click on the Next Step button to continue and save your ruleset.

Now that everything is set up, you can switch to the Publish tab to make your campaign go to live. Simply switch to the ‘Publish Status’ from Draft to Publish by clicking on it.

Publish your geotargeting campaign in WordPress

Don’t forget to click on the Save changes button to save your campaign settings and then click on the close button to exit the builder.

After that, you’ll be redirected back to your WordPress site, where you can configure where and when you want to display the campaign.

Publishing your campaign in WordPress

Simply set the status from pending to published and click on the ‘Save Changes’ button to launch your campaign.

You can now visit your WordPress website in incognito mode to view your campaign. You’ll need to be in the location that you are targeting to view the campaign.

Geotargeted popup in WordPress showing a custom message

Note: If you are not located in that region, then you can check out a VPN service that has servers located in that region. This will allow you to mimic the location you want to target with your geotargeting campaigns.

Other Geotargeting Campaign Ideas for WordPress using OptinMonster

A header bar announcing free shipping with a countdown timer to trigger the FOMO effect.

A floating banner with countdown timer triggered by geo-location targeting

A slide-in message targeting local users to request a callback from your sales team.

A geo targeted slidein message

Here is an example of an inline campaign to help users discover content relevant to their location.

Inline campaign showing users locally relevant information

Using Geolocation Data in WordPress Forms

Forms help you generate leads, engage with customers and website visitors, and grow your business. Using geolocation data, you can learn more about your customers and offer them more local content.

For this, you’ll need WPForms. It is the best WordPress form builder plugin on the market and allows you to create any kind of form you need.

It also comes with a Geolocation addon that helps you collect users’ geolocation information with form submissions.

First, you need to install and activate the WPForms plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit the WPForms » Settings page to enter your license key. You can find this information under your account on the WPForms website.

Enter WPForms license key

Next, you need to visit WPForms » Addons page. From here, you need to click on the ‘Install Addon’ button next to the GeoLocation Addon.

Geolocation addon

WPForms will now fetch, install, and activate the addon for you.

You can now go ahead and create your first form by visiting WPForms » Add New page. You’ll start by entering a name for your form and choose a template.

Creating a new form

A template is a starting point that you can use to quickly make forms. You can start with a blank form too, if you want.

Clicking on a template will launch the form builder interface. On the right, you’ll see pre-loaded form fields based on the template you choose. You can add new fields from the column on your left side.

Form builder

You can also just click on any field to edit it, drag and drop to move it, or delete any form field.

Once you are finished, don’t forget to click on the Save button to publish your form.

Your form is now ready. In order to collect Geolocation data, you need to add the form to your website.

WPForms makes it super easy to add your forms anywhere on your website. Simply edit the post or page where you want to add the form and click on the (+) add new block button.

Locate the WPForms block and add it to your post.

WPForms block

From block settings, simply select the form you created earlier. WPForms will load a live preview of your form in the content editor. You can now save your post or page and view your form in action.

Viewing Geolocation Data for Your Form Entries

After you have added the form to your website, wait for it to collect a few form entries or go ahead and add a few test entries on your own.

After that, you can go to WPForms » Entries page and click on your form name to view entries. On the Entries page, click on the View link next to any entry to view the details.

Viewing form entries in WPForms

On the entry details page, you will see a box with user’s Geographic location marked on the map.

Geolocation pointed on a map

Using Geolocation Data for Your WordPress Forms

Geolocation data can be used to grow your business. You can figure out which regions are showing more interest in your products, services, or website.

You can match this data with your Google Analytics reports to see which regions are not performing well. If your business serves a global audience, then you may consider offering forms in local languages.

Using GeoTargeting in WooCommerce

WooCommerce is the biggest eCommerce platform in the world that runs on top of WordPress. It comes with built-in geolocation feature that allows you to detect user’s location and use it to display taxes and shipping information.

For this section, we assume that you have already set up your online store. If you haven’t, then follow our guide on how to create an online store for step by step instructions.

After that, you need to visit WooCommerce » Settings page and scroll down to the ‘General Options’ section.

Geolocation settings in WooCommerce

From here you can select the countries or regions where you sell or ship to. You can also modify the ‘Default customer location’ option.

By default, WooCommerce assumes customer’s location to ‘no location’. You can change that to use your store address or use Geolocate to find the customer’s country.

Note: Geolocate feature will only lookup user’s country using their IP address and WooCommerce uses a third-party integration to fetch this information.

You can also use Geolocate with page cache support. The downside of choosing this is that your product URLs will show a v=XXXX string.

Don’t forget to click on the ‘Save Changes’ button to store your settings.

Next, you need to switch to the Integrations tab and you’ll see an option where you’ll be asked to provide a MaxMind API key.

MaxMind API key

This third-party service will lookup for GeoLocation information for your WooCommerce store.

Now, you need to sign up for a MaxMind free account. Once you have completed the sign up, go ahead and login to your account dashboard.

From here you need to click on Services » Manage License Keys menu. On the next page, click on the Generate New License Key button.

Generate license key

After that, simply copy the generated API key and paste it into your WooCommerce settings.

Don’t forget to click on the ‘Save Changes’ button to store your settings.

WooCommerce will now start using Geolocate data to calculate taxes and shipping costs. However, you’ll still need to configure shipping zones, shipping costs, and taxes.

We hope this article helped you learn how to use GeoTargeting in WordPress boost sales and improve user experience. You may also want to see our proven tips to increase website traffic, and our comparison of the best business phone services for small businesses.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post Ultimate Guide to Geotargeting in WordPress – Step by Step appeared first on WPBeginner.