WooCommerce – Restrict Products by State or Province

Are you trying to restrict WooCommerce products by state or province from a country? Maybe you want to hide products for some states while displaying them for other states? Or maybe you want to display a different WooCommerce catalog based on provinces?

You’re in the right place, as we will show you how to geotarget different WooCommerce product catalogs by states or provinces.

woocommerce restrict products by state or province

After applying the changes we will show you in this WordPress tutorial, your WooCommerce products will disappear when customers select a restricted state or province.

For example, here we have selected Alabama, and the products have been hidden from the catalog. Customers will see a message telling them we don’t have products allowed for their location.

woocommerce restrict products by state or province

However, if we select a state or province that is not restricted, the products will display on the catalog:

woocommerce restrict products by state or province

You’ll be able to hide products by state or province globally or individually.

Product visibility based on location

To apply this conditional visibility based on states or provinces, we will use the WooCommerce Restrictions by Location plugin.

It allows you to restrict products, variations, categories, and discount coupons by country or continent, states or provinces, zip code, and even using a custom list of locations.

You can create different catalogs for different states or provinces in your WooCommerce store. You can also show different product prices and descriptions for different countries, states or provinces.

After installing and activating the plugin, follow the steps in the sections below to restrict your WooCommerce products by state or province.

Set up the global settings of the plugin

In order to restrict or hide products by state or province, we need to start by setting up the global settings of the plugin.

Go to WooCommerce > Product Restrictions by Location and click on Open global settings.

Once there, you need to select these settings:

  • I want to restrict: Products and variations
  • I want to restrict by: States/provinces from one location
  • Now enter the states or provinces that will be available for selection by the customers.
  • Click on Save changes.
woocommerce restrict products by state or province

Important. The list of states will be from the “base country” defined in the WooCommerce settings. To change the base country, go to WooCommerce > Settings > General > Store Address > Country.

Option 1 – Globally restrict products by state or province

Let’s see how to globally restrict WooCommerce products by state or province. We’ll ban states or provinces from viewing and purchasing any products on our WooCommerce store.

Just move to the Products per location tab in the Restrictions by location settings, and select the following values:

  • Products per location: Here you need to enter the states where your products will be restricted.
  • Sell in selected countries/states: No
  • What happens when a customer location is restricted: Here we will select “Exclude from catalog listing”, but you have other options:
    • The product page should disappear completely
    • The product page should show the contents from another page
    • Redirect product page to a specific URL
    • Show a message in the product page
    • Show a message in the checkout page
    • Remove product from the cart and checkout
    • Remove the add to cart button
    • Hide the product price
    • Hide the product reviews
    • Remove product link from menus
  • Once you select these values, Save changes.
woocommerce product visibility by state

The plugin allows you to set up a popup that will ask customers to select their state or province.

woocommerce product visibility by state

Depending on the settings you select, you can disable the option to close the popup without selecting the state or province. You can also choose whether you want to display the popup only the first time they visit the site or on every reload until they select their state/province.

User will also be able to select their province/state using a dropdown selector on navigation menus.

Follow this guide to understand how to set up your popup and header selector.

When customers from a restricted state or province try to view your WooCommerce products, they will instead see a message telling them there are no products allowed for thir location.

woocommerce product visibility by state

On the other side, when users select an allowed country, they will view the products on the catalog without any problems.

woocommerce product visibility by state

This is how you can restrict all WooCommerce product for specific states or provinces. But if you want to individually edit product visibility by state or province, follow the steps in the section below.

Option 2 – Restrict individual products by state

If you don’t want to globally restrict all your WooCommerce products by state, you can pick some products and restrict them by state without any problems.

For example, we will hide our “Black Elegance Dress” product for Alaska, Alabama and Arizona. This means that states like California should be able to view the product on the catalog.

woocommerce restrict products by state

To block catalog visibility based on the state or province for specific products:

  1. Go to Products in wp-admin.
  2. Open the product you want to restrict by state.

Now need to select the following values in the Product data fields:

  • Selected locations: Enter the states where your products will be restricted.
  • Available in selected locations: No
  • Update the product.
woocommerce restrict products by state

Once you apply the changes, the customers from the blocked states or provinces will see all other products, but they won’t see the restricted product(s).

woocommerce restrict products by state

However, customers from states or provinces that are not restricted will be able to view the products:

woocommerce restrict products by state

Restricting WooCommerce products by states or provinces with the WooCommerce Restrictions by Location plugin offers numerous benefits like:

  • Ensuring compliance with regional regulations
  • Optimizing logistics and shipping processes
  • Customizing products for local preferences
  • Managing legal and tax considerations
  • And many benefits more!