Geolocation-Based Rules

How Geo-Targeting Works

Geo-targeting lets you hide or show prices based on the visitor’s country. This is useful for region-specific pricing, export restrictions, or showing different CTAs by region.

Setup

GeoIP Data Source

Hide Price Pro uses WooCommerce’s built-in MaxMind GeoIP database as the primary source. If MaxMind is not configured, it falls back to the ip-api.com service. Country lookups are cached for 24 hours to minimize API calls.

Creating a Geo Rule

  1. Create a new rule
  2. Go to the Geo & Advanced tab
  3. Select Include Countries or Exclude Countries
  4. Choose countries from the dropdown
  5. Configure your action as usual

Examples

Hide Prices Outside Your Country

If you only sell domestically, hide prices for all countries except yours. Set “Include Countries” to your country, and create a separate rule for all other countries with a “Contact us” message.

Region-Specific Messaging

Create multiple rules with different replacement text per region: “Available in EU — contact local distributor” for EU countries, normal prices for domestic visitors.

Caching Considerations

If you use a page cache (LiteSpeed, WP Super Cache, etc.), geo-targeted rules may not work correctly because cached pages serve the same content to all visitors. You may need to exclude product pages from caching, or use AJAX-based price loading.

Was this article helpful?