Linux 软件免费装
Banner图

WindCodex GeoBlock

开发者 dhimahisolutions
windcodex
更新时间 2026年4月20日 13:28
PHP版本: 7.4 及以上
WordPress版本: 6.9
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce geolocation geo blocking product visibility country restriction

下载

1.0.0

详情介绍:

Country Restrictions for WooCommerce lets you control exactly which products customers can see and buy based on their country - using WooCommerce's built-in geolocation engine. No API key. No third-party service. No code required. Whether you need to comply with regional laws, manage export restrictions, honour licensing agreements, or limit shipping destinations - this plugin gives you precise per-product country control in minutes. Why store owners choose this plugin 3 Restriction Modes - Choose how to handle each restricted product Hide completely Product is removed from shop pages, search results, and category listings for restricted visitors. Direct product URL returns a 404 page. Optionally redirect restricted visitors to a custom URL instead. Hide from catalog, allow direct URL Product is hidden from shop and search. The product page still loads via direct link - useful for distributors or partners in restricted regions. You can optionally allow full purchase via direct URL with a single toggle. Show restriction message Product stays visible in the catalog. On the product page, the Add to Cart button and price are replaced with your custom HTML message. Perfect for explaining regional availability without making the product invisible. Key Features Plugin Compatibility Built-in compatibility layers for 6 popular plugins - no configuration needed: Use Cases Shortcode Display the restriction message anywhere using: [geoblock_product_message] Attributes: How It Works
  1. Install and activate the plugin.
  2. Go to WooCommerce > GeoBlock Restrictions and choose a restriction mode.
  3. Open any product and find the GeoBlock - Country Restrictions meta box.
  4. Select Include or Exclude, choose your countries, and save.
  5. GeoBlock automatically detects each visitor's country and applies your rules in real time.
Requirements Privacy GeoBlock uses the visitor's IP address solely to determine their country. No personal data is stored permanently. Detection results are cached in WooCommerce session storage and WordPress transients with a 1-hour TTL. No data is sent to external servers. This plugin does not collect, sell, or share any visitor data.

安装:

From your WordPress dashboard:
  1. Go to Plugins Add New.
  2. Search for WindCodex GeoBlock.
  3. Click Install Now, then Activate.
Manual installation:
  1. Download the plugin ZIP file.
  2. Upload the windcodex-geoblock folder to /wp-content/plugins/.
  3. Activate through the Plugins screen in WordPress.
After activation:
  1. Go to WooCommerce Settings > General and set -Default customer location- to Geolocate or Geolocate (with page caching support).
  2. Go to WooCommerce > GeoBlock Restrictions to choose your global restriction mode.
  3. Edit any product and use the GeoBlock - Country Restrictions meta box to set rules.

屏幕截图:

  • **Settings Page - Advanced Tab** - Force Geolocation and Debug Mode toggles.
  • **Product Meta Box** - Per-product Include/Exclude country rule with searchable country selector and live rule summary preview.

升级注意事项:

1.0.0 Initial release - no upgrade steps required.

常见问题:

Does this plugin require any API key or account?

No. This plugin uses WooCommerce's built-in geolocation engine (MaxMind GeoLite2), which is already included with WooCommerce. No external API key, account, or paid service is required.

Which countries can I restrict?

All countries supported by WooCommerce - the same full country list used in WooCommerce shipping and tax settings. You can restrict any single country or any combination of countries on each product.

Will this work with page caching plugins like WP Rocket or LiteSpeed?

Yes. Set WooCommerce's -Default customer location- to Geolocate (with page caching support) (AJAX mode). Country detection happens via AJAX after page load, so it works correctly even on fully cached pages. GeoBlock also includes a built-in WP Rocket compatibility layer that excludes product pages from cache.

What happens if geolocation is not enabled in WooCommerce?

GeoBlock shows a warning banner in the plugin settings page. Without geolocation, guest visitors fall back to the store's base country and restrictions will not apply to them. Logged-in customers with a saved shipping or billing address are still detected correctly.

Does this work with variable products and product variations?

Yes. Country rules are set at the parent product level and automatically apply to all variations. In Hide and Catalog Only modes, the entire product including all variations is restricted. In Message mode, the variation dropdowns and Add to Cart button are both hidden on the product page.

What if a customer uses a VPN?

GeoBlock detects country based on IP address. A customer using a VPN may appear to be in a different country. For stores where VPN circumvention is a concern, we recommend enabling the -Force Geolocation- option which ignores saved addresses and always uses current IP detection.

What happens if a restricted product is already in a customer's cart?

GeoBlock automatically removes restricted products from the cart when the customer visits the cart or checkout page, and displays a clear notice explaining why. Checkout is also blocked as a final safety net even if the cart page was skipped.

Can I set different rules for different products?

Yes. Each product has its own independent set of rules. You can have Product A restricted to only Europe, Product B excluded from one country, and Product C with no restrictions at all - all at the same time.

Does restricting products affect SEO or Google indexing?

No. Country restrictions are applied at the application level for logged-in users and detected visitors. Search engine crawlers are not affected and your products continue to be indexed normally. Country-based restrictions are a standard and accepted practice in international e-commerce.

Is this plugin GDPR compliant?

Yes. GeoBlock processes IP addresses only to determine the visitor's geographic country for restriction purposes - a legitimate interest under e-commerce operation. No personal data is stored beyond the session/transient TTL (1 hour). No data is shared with third parties. Review and update your own privacy policy to document your use of geolocation.

Does this work with WooCommerce Subscriptions?

Yes. GeoBlock's compatibility layer hooks into WooCommerce Subscriptions' own purchasability filters, fully supporting both subscription and variable-subscription product types.

Can I use this with Elementor, Divi, or other page builders?

Yes. Use the [geoblock_product_message id=PRODUCT_ID] shortcode in any page builder element or custom template to display the restriction message anywhere on your site.

How do I test that restrictions are working correctly?

Enable Debug Mode in WooCommerce GeoBlock Restrictions Advanced. A debug toolbar will appear at the bottom of every frontend page (visible to admins only) showing the detected country, IP address, and detection method. You can also temporarily change the restriction rule to include your own country to verify the hide/message behaviour.

Will restricted products still be accessible via direct URL in -Hide completely- mode?

In Hide completely mode, the direct product URL returns a 404 page. You can optionally configure a redirect URL to send restricted visitors to a custom page (like a contact or coming-soon page) instead of a 404.

更新日志:

1.0.0