⌘K

Country-based restrictions

Last updated

Version note: This guide covers the v1.2.0 development build. Settings may differ from your installed Marketplace version. Verify your version before following these steps; runtime compatibility has not yet been confirmed.

Country rules use WooCommerce geolocation to determine the visitor’s country from their IP address. They do not use the shipping-country or billing-country fields as the rule source.

Configure one country

  1. Open Country-Based Restriction.
  2. Choose a country in Select Country.
  3. Turn on Enable Country-Based Restrictions.
  4. Select the products and/or categories to restrict.
  5. Choose Save Country Settings.
  6. Reopen that country entry and verify its selections.
  7. Test with a visitor whose detected IP country matches the rule, then compare a nonmatching visitor.

Entries appear under Configured Countries. Make sure the rule is enabled for the country you are testing.

Location and cache considerations

If geolocation returns no country, this implementation does not apply a country-specific restriction. Another global, role, or order rule can still apply.

IP-derived location can differ from a customer’s delivery address. Changing the checkout country alone is not a reliable way to test these rules. Check WooCommerce’s geolocation configuration and your host’s handling of visitor IP addresses if the result is unexpected.

Verify that your caching arrangement does not serve one visitor’s restricted or unrestricted catalogue to a different visitor. Country rules should not be treated as a guaranteed legal or geographic access-control boundary.

Still stuck? How can we help? Get Help