[WordPress] 外掛分享: WindCodex GeoBlock – WooCommerce Country Restriction & Geo Blocking

首頁外掛目錄 › WindCodex GeoBlock – WooCommerce Country Restriction & Geo Blocking
WordPress 外掛 WindCodex GeoBlock – WooCommerce Country Restriction & Geo Blocking 的封面圖片
全新外掛
安裝啟用
尚無評分
剛更新
最後更新
問題解決
WordPress 6.9+ PHP 7.4+ v1.0.2 上架:2026-04-14

內容簡介

WindCodex GeoBlock 是一款專為 WooCommerce 設計的外掛,能夠根據國家限制產品銷售,無需 API 金鑰或第三方服務。它幫助商店擁有者遵守法律、管理授權區域,並自動調整產品目錄,以提高銷售效率。

【主要功能】
• 每產品國家規則設定
• 包含或排除模式選擇
• 自訂限制訊息顯示
• 三種限制模式選擇
• 自動調整國別目錄

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「WindCodex GeoBlock – WooCommerce Country Restriction & Geo Blocking」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

WindCodex GeoBlock lets you restrict WooCommerce products by country using WooCommerce’s built-in geolocation – no API key, no third-party service, no code required.
Whether you need to comply with local laws, honour export restrictions, manage licensing territories, or simply limit shipping to countries you serve – GeoBlock gives you per-product country control in minutes.
Why Store Owners Choose GeoBlock

Stop failed deliveries – Block customers from ordering products you cannot ship to their location.
Stay legally compliant – Restrict alcohol, supplements, age-restricted, or regulated products by region.
Honour licensing agreements – Limit digital downloads and licensed content to permitted territories.
Build country-specific catalogs – Show a tailored product range to each market automatically.
Reduce chargebacks – Prevent orders you would only have to cancel and refund anyway.

3 Restriction Modes
Hide Completely
Product disappears from shop pages, search results, and category listings. The direct product URL returns a 404 page. Optionally redirect restricted visitors to any custom URL instead.
Hide from Catalog – Allow Direct URL
Product is hidden from the shop and search but remains accessible via its direct link. Useful for distributors or B2B partners in restricted regions. A single toggle lets direct-URL visitors purchase too.
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 – ideal for explaining regional availability without hiding the product entirely.
Key Features

Per-product country rules – Set include or exclude rules on any product from the product edit screen, with a searchable country selector and live rule summary.
Include or Exclude mode – Whitelist specific countries (only they can buy) or blacklist countries (everyone except them can buy).
Custom restriction message – Write your own HTML message with links, bold text, or any WordPress-allowed markup.
Configurable message position – Place the restriction notice above the title, below the title, after the description, or before product meta.
Redirect on restriction – In Hide mode, send restricted visitors to any URL instead of a 404 page.
Cart & checkout protection – Restricted products added to cart before a rule was applied are automatically removed, with a clear customer notice.
Server-side add-to-cart validation – Blocks direct POST, REST API, and AJAX add-to-cart attempts. Not just client-side.
Smart country detection (6 layers) – Shipping address → billing address → WC session → transient cache → MaxMind GeoLite2 → store base country. No manual input needed.
Cloudflare IP support – Reads CF-Connecting-IP automatically for sites behind Cloudflare.
Force Geolocation option – Ignore saved addresses and always detect country from current IP.
Session & transient caching – Country detection results cached per session. Zero repeated geolocation lookups.
Admin debug toolbar – Shows detected country, IP address, detection source, and a settings link. Visible to admins only.
Shortcode support – [geoblock_product_message] renders the restriction message in any page builder, custom template, Elementor, or Divi.
HPOS compatible – Fully supports WooCommerce High-Performance Order Storage.
Translation ready – Complete .pot file included. Compatible with Loco Translate and WPML String Translation.

Plugin Compatibility
Built-in compatibility for 6 popular plugins – no configuration needed:

Price Based on Country for WooCommerce – Restriction message takes priority over country-based pricing on restricted products.
WPML – Rules set on the original-language product automatically apply to all translated copies. No duplicate rules per language.
WooCommerce Product Bundles – Restricting the bundle parent blocks the entire bundle from purchase.
WooCommerce Subscriptions – Both subscription and variable-subscription product types fully supported.
WP Rocket – Product pages automatically excluded from page cache so every visitor gets the correct restricted or unrestricted version.
Speed Optimizer by SiteGround – Product pages bypass SiteGround’s dynamic cache via SGCACHENOCACHE and sgo_bypass_cache.

Use Cases

Block alcohol or age-restricted products from countries where they are prohibited by law
Restrict physical goods to only the countries you ship to
Limit digital downloads to licensed territories
Hide out-of-stock regional variants from international markets
Display a “contact us to order in your region” message instead of hiding the product
Build exclusive country-specific product catalogs for different markets

Shortcode
Display the restriction message anywhere on your site using:
[geoblock_product_message]
Attributes:
* id – Product ID to check. Defaults to the current product in the loop.
* class – Extra CSS class(es) added to the message wrapper div.
Examples:
[geoblock_product_message id=123]
[geoblock_product_message id=123 class=”my-notice highlight”]
How It Works

Install and activate the plugin.
Go to WooCommerce > GeoBlock and choose a restriction mode.
Open any product and find the GeoBlock – Country Restrictions meta box.
Select Include or Exclude, choose your countries, and save.
GeoBlock automatically detects each visitor’s country and applies your rules in real time.

Requirements

WordPress 5.8 or higher
WooCommerce 7.0 or higher
PHP 7.4 or higher
WooCommerce Geolocation must be enabled: WooCommerce Settings > General > Default customer location > Geolocate

🚀 Pro Version
Need bulk category rules, payment gateway restrictions by country, variation-level rules, or an analytics dashboard?
GeoBlock Pro is available at windcodex.com
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.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon