
內容簡介
GeoShield - Country Restrictions Lite for WooCommerce 讓您根據客戶的國家控制產品的可見性與購買權限,無需任何配置,並提供快速的隱私優先地理定位功能,適合處理區域授權協議及跨境運輸限制。
【主要功能】
• 按國家限制產品可見性
• 支援黑名單與白名單選擇
• 針對產品變體設定獨立限制
• 快速多層地理定位引擎
• 自訂限制訊息顯示
外掛標籤
開發者團隊
② 後台搜尋「GeoShield – Country Restrictions Lite for WooCommerce」→ 直接安裝(推薦)
原文外掛簡介
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
Install and activate GeoShield – Country Restrictions Lite.
Edit any WooCommerce product and open the Country Restrictions tab in the Product Data panel.
Toggle on Enable Restrictions, select your mode (Blacklist or Whitelist), and choose your target countries.
Choose your restriction action: Hide Product (catalog removal + direct access control) or Disable Checkout (show product with custom restriction message).
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.
