BACK TO DIRECTORY

GeoShield – Country Restrictions Lite for WooCommerce

by R.Sabbir

0.0
(0 ratings)

GeoShield – Country Restrictions Lite for WooCommerce lets you control exactly which products are visible and purchasable based on your customer’s country — using fast, privacy-first geolocation with zero configuration required.

Whether you are dealing with territorial licensing agreements, cross-border shipping limitations, regional export compliance regulations, or localized product lines, GeoShield gives you granular control over your product catalog by country — without writing a single line of code.

HPOS Compatible · WooCommerce Blocks Ready · Cloudflare & CDN Friendly · 100% Privacy & GDPR Safe

What You Can Do

  • Restrict products per country — Choose between Blacklist (block selected countries) or Whitelist (allow only selected countries) directly inside the WooCommerce product editor.
  • Two flexible restriction actions — Choose what happens when a customer visits from a restricted country:
    • Hide Product (Full Restriction) — Automatically removes the product from the shop catalog and search results. Direct single-product URL visits cleanly return a 404 page or redirect to the shop page.
    • Disable Checkout (Lock Purchase) — Keeps the product visible in the catalog, but locks purchasing by removing the Add to Cart button and displaying a custom restriction notice.
  • Variation-level country restrictions — Apply independent restriction rules to individual product variations. Sell specific sizes, colors, or options globally while restricting others within the same variable product.
  • Fast, multi-layer geolocation engine — Detects visitor country instantly:
    • Checks Cloudflare’s country header (CF-IPCountry) first for instant 0ms edge detection.
    • Uses WooCommerce’s native MaxMind GeoIP2 integration for accurate local server detection.
    • Gracefully falls back to IP geolocation if MaxMind is not configured.
    • Includes automated localhost detection so developers can test rules locally without configuration.
  • Custom restriction messages — Set personalized notices per product or per variation explaining to restricted shoppers why the item is unavailable in their location.
  • Global fallback settings — Set a storewide fallback restriction message and configure direct URL access behavior (Return 404 or Redirect to Shop).
  • Multi-layer catalog & checkout protection — Enforces restrictions across shop loops, product archives, search results, single product templates, cart additions, and checkout submissions.
  • WooCommerce Blocks & Classic ready — Works seamlessly with both classic shortcodes and the new WooCommerce Cart & Checkout blocks via the WooCommerce Store API.
  • HPOS Compatible — Fully certified for WooCommerce High-Performance Order Storage (custom order tables).
  • Privacy-first & GDPR compliant — Uses local MaxMind geolocation first. No customer personal data (names, emails, addresses) is ever collected, stored, or transmitted.

How It Works

  1. Install and activate GeoShield – Country Restrictions Lite.
  2. Edit any WooCommerce product and open the Country Restrictions tab in the Product Data panel.
  3. Toggle on Enable Restrictions, select your mode (Blacklist or Whitelist), and choose your target countries.
  4. Choose your restriction action: Hide Product (catalog removal + direct access control) or Disable Checkout (show product with custom restriction message).
  5. Save the product. Customers visiting from restricted locations will automatically experience your configured rules.

Compatible With

GeoShield is built strictly to WordPress and WooCommerce coding standards and is tested for compatibility with:

  • Multilingual plugins — WPML, Polylang, TranslatePress, Weglot
  • Page builders — Elementor, Divi, Beaver Builder, Gutenberg Block Editor
  • Search plugins — Advanced Woo Search, Relevanssi, FiboSearch
  • Caching plugins — WP Rocket, LiteSpeed Cache, W3 Total Cache, WP Super Cache, SiteGround Optimizer
  • Multi-currency plugins — Works harmoniously with WooCommerce currency switchers
  • WooCommerce Subscriptions — Variation-level and product-level restrictions supported on subscription products

Important Note for Caching

Caching plugins and Content Delivery Networks (CDNs like Cloudflare) can sometimes cache full HTML pages. To ensure geolocation restrictions take effect instantly:
* Ensure your caching plugin is set to vary cache by WooCommerce’s geolocation cookie (woocommerce_geo_hash).
* Alternatively, enable “Geolocate (with page caching support)” under WooCommerce > Settings > General. This allows WooCommerce to handle country detection via an unobtrusive AJAX endpoint on cached pages.
* If using Cloudflare, GeoShield automatically leverages Cloudflare’s CF-IPCountry header for instant, zero-latency detection.

External Services

GeoShield Lite is engineered to use WooCommerce’s local MaxMind GeoIP2 database and server headers whenever possible. In cases where local MaxMind data is not configured in WooCommerce settings, the plugin includes lightweight fallback services to ensure uninterrupted protection:

IP Address Detection Service (ipify)

  • Purpose: Detects the server or visitor public IP address when running behind reverse proxies, CDNs, or load balancers.
  • When it is used: Only when the local server environment cannot resolve the visitor’s public IP address (such as local development environments).
  • Data transmitted: A standard HTTPS request to api.ipify.org. No personal data, store information, or customer credentials are ever sent.
  • Service provider: ipify API (https://www.ipify.org)
  • Privacy Policy: https://www.ipify.org

Geolocation Fallback Service (IP-API)

  • Purpose: Resolves an IP address to country and region codes to enforce restrictions when WooCommerce MaxMind GeoIP is not installed.
  • When it is used: Only as a fallback when WooCommerce native geolocation is unavailable.
  • Data transmitted: The visitor’s IP address is sent over HTTPS to determine country code.
  • Service provider: IP-API (https://ip-api.com)
  • Privacy Policy: https://ip-api.com/docs/legal

Note: You can eliminate all third-party external requests by configuring the free MaxMind GeoIP license under WooCommerce > Settings > Integration. With MaxMind configured, 100% of geolocation lookups remain strictly local on your web server.

Screenshots

Product Country Restrictions — Intuitive country inclusion and exclusion rules directly inside the WooCommerce product editor.

Product Country Restrictions — Intuitive country inclusion and exclusion rules directly inside the WooCommerce product editor.

Dashboard & Status — High-level overview of store restriction settings and active configuration.

Dashboard & Status — High-level overview of store restriction settings and active configuration.

Frontend Notice — User-friendly custom notice displayed in place of the Add to Cart button for restricted visitors.

Frontend Notice — User-friendly custom notice displayed in place of the Add to Cart button for restricted visitors.

Global Options — Storewide visibility defaults and restriction controls under the GeoShield settings menu.

Global Options — Storewide visibility defaults and restriction controls under the GeoShield settings menu.

Plugin Details

Active Installs
0
Total Downloads
326
Version
1.0.2
Requires WP
6.0
Requires PHP
7.4
Tested Up To
7.1
Added
2026-04-24
Last Updated
2026-09-08 12:07pm GMT

Ratings

5
0
4
0
3
0
2
0
1
0