Documentation
GeoBlock Pro
Per-Product Rules

Per-Product Rules

Per-product rules give you fine-grained control over which countries can purchase a specific product, overriding any bulk rules that might otherwise apply.


Simple Products

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

Exclude Countries - The product is restricted only in the selected countries; all other countries can purchase.

Include Countries - The product is restricted everywhere except the selected countries; only the listed countries can purchase.

Use the searchable Select2 country picker to find countries by name or 2-letter ISO code. Rules are saved as JSON in the _geoblock_rules post meta key.


Variable Products & Variation-Level Rules

Variation-level rules are a Pro feature. They allow different countries per variation, overriding the parent product rule.

In the Variations tab of the product editor, each variation exposes its own GeoBlock fieldset:

  1. Expand a variation panel.
  2. Select Restrict Mode: Exclude or Include.
  3. Pick countries using the searchable multi-select.
  4. Save the product.

Rules are stored in _geoblock_variation_rules post meta as a JSON object keyed by variation ID:

{
  "12345": {
    "mode": "exclude",
    "countries": ["US", "CA"]
  },
  "12346": {
    "mode": "include",
    "countries": ["DE", "FR", "IT"]
  }
}

Rule Resolution for Variable Products

When a visitor views a variable product, GeoBlock evaluates rules in this order:

  1. If the customer has selected a specific variation: the variation rule is checked first.
  2. If no variation rule exists for that variation: the parent product rule is used.
  3. If no product rule exists: bulk rules are evaluated.

This means a variation-level rule always takes precedence over a parent product rule, which in turn takes precedence over any bulk rule. See Bulk Rules → Rule Priority for the full priority table.