Documentation
GeoBlock Pro
Per-Product Rules

Per-Product Rules

Per-product rules restrict a single product. They work together with bulk rules - see How rules combine.


Simple and Variable Products

Open any product in the WooCommerce product editor and scroll to the GeoBlock - Country Restrictions meta box.

Rule TypeBehaviour
Exclude (default) - "Restrict these countries"Customers from the listed countries are restricted
Include - "Allow ONLY these countries"Only customers from the listed countries can purchase; everyone else is restricted

Use the searchable country picker to find countries by name or 2-letter ISO code. Leaving the list empty removes all restrictions from the product.

Rules are saved in the _geoblock_rules post meta of the product.


Variation-Level Rules

Variation-level rules are a Pro feature. They let each variation of a variable product have its own countries.

In the Variations tab of the product editor, expand a variation. Each variation has a GeoBlock Variation Restriction section:

  1. Choose Exclude selected countries or Include selected countries.
  2. Pick the countries.
  3. Click Save changes.

Leave the country list empty to inherit the parent product and bulk rules.

Each variation stores its own rule in the _geoblock_variation_rules post meta of that variation:

array(
    'mode'      => 'exclude',            // 'include' | 'exclude'
    'countries' => array( 'US', 'CA' ),  // 2-letter ISO codes
)

A restricted variation can't be added to the cart, while the product's other variations remain available.


How Rules Combine

For a given product (or variation) and the visitor's country:

  1. Variation rule - if the variation has its own countries set, that rule alone decides. Product and bulk rules are ignored for that variation.
  2. Otherwise, the product is restricted if any of these restricts it:
    • the per-product rule
    • any matching bulk rule (category, tag, attribute or global)
⚠️

A per-product Include rule does not override a bulk rule. If a bulk rule restricts a country, the product is restricted there even when its own rule allows that country. To exempt a single product from a bulk rule, use a variation rule (for variable products) or change the bulk rule's scope.