跳到内容

CodeFaeries Country Based Content for WooCommerce – Redirects and Prices by Country

v1.5.1

Long Watch Studio - Code Faeries · 2026年6月25日 上架

Redirect visitors, hide prices or the add-to-cart button, and adjust prices by country in WooCommerce, using WooCommerce's built-in geolocation.

正在使用
10 以下
评分
暂无
累计下载
703
最近更新
2026年11月23日
需要 WordPress 6.0+已测试到 7.1.5PHP 7.4+

截图

Hide prices and the add-to-cart button by country: the same product page seen from France and from Germany, with a "not available" message
Hide prices and the add-to-cart button by country: the same product page seen from France and from Germany, with a "not available" message
Price by country: the same category seen from France and from Switzerland, where a rule adds 10 %
Price by country: the same category seen from France and from Switzerland, where a rule adds 10 %
Hide whole products by country: a product listed for France is absent from the category for the United States
Hide whole products by country: a product listed for France is absent from the category for the United States
Country switcher: visitors choose their country with the [cbc_country_selector] shortcode, and prices follow
Country switcher: visitors choose their country with the [cbc_country_selector] shortcode, and prices follow
Redirect by country: rules with a source path and a target URL, and the simulator showing where a visitor from Spain lands
Redirect by country: rules with a source path and a target URL, and the simulator showing where a visitor from Spain lands
Content rules by country, category or product, and the simulator listing the effects applied to a product
Content rules by country, category or product, and the simulator listing the effects applied to a product
Features and settings: turn each feature on, and take the country from geolocation or from the customer's address
Features and settings: turn each feature on, and take the country from geolocation or from the customer's address

Country Based Content adapts your WooCommerce store to each visitor’s country. Redirect visitors to another page, hide prices or the add-to-cart button, and adjust prices by country, using the country detected by WooCommerce’s built-in geolocation.

The free version has no limit on the number of rules.

Pro version

Free features

Redirect by country

  • Redirect visitors to a specific URL based on their country: regional stores, local regulations (GDPR notices, age restrictions), market-specific landing pages
  • Source patterns: target a path on your site where * matches any characters, and reuse the matches in the target with $1, $2
  • Search engine and ad-platform crawlers are exempted from redirects (enabled by default), so advertising campaign verification is not affected
  • Choose the HTTP status of each redirect: 302 temporary (default), 301 permanent or 307 temporary

Hide prices, the add-to-cart button or whole products by country

  • Hide prices for the countries you choose
  • Hide the add-to-cart button to prevent purchases while keeping products visible
  • Hide products completely from the shop, categories and search
  • Show a “not available” message in place of what is hidden
  • Target all products, specific categories or individual products; a variation follows the rules of its product
  • Rules also apply to the block cart and checkout, and to add-to-cart links

Price by country

  • Percentage increase or decrease
  • Add or subtract a fixed amount
  • Set a different price per country
  • Adjusted prices apply in the cart and at checkout, not only on display
  • Choose whether several matching price rules add up in priority order, or only the highest-priority rule applies

Exemptions and testing

  • Exempt logged-in users or specific roles, so administrators and shop managers always see the real store
  • Test simulator on each rules screen to preview which rule would match
  • “Force Country” developer tool to simulate visits from any country, for logged-in shop managers and administrators only
  • Export your rules and settings as a JSON file and import them on another site
  • WooCommerce HPOS compatible (High-Performance Order Storage)

Geolocation on your server

The plugin makes no remote request itself: the country is detected by WooCommerce’s geolocation. When WooCommerce’s MaxMind GeoLite2 database resolves the visitor’s address, detection stays on your server, with no data sent to third parties. Otherwise WooCommerce may fall back to an external service (see “External services”). To keep detection on your server, enter a MaxMind license key in WooCommerce > Settings > Integration > MaxMind Geolocation.

Pro version

  • Payment and shipping restrictions – Restrict payment methods and shipping methods by country, with country groups
  • Currency conversion – Show prices in the visitor’s currency, 30+ currencies, automatic exchange rates (ECB reference rates, fetched from the third-party Frankfurter API when Auto-Fetch Rates is enabled) or manual rates, rounding rules
  • Content by country shortcode – Show any content to the countries you choose with [cbc_content countries="FR,BE,CH"], or to every country but some with match="exclude"
  • State and region targeting – US states, Canadian provinces, German Länder, Australian states and more
  • Rich alternative content (HTML) in place of hidden products, prices or buttons
  • Tax message by country
  • Priority support

Get the Pro version

Requirements

  • WordPress 6.0 or higher
  • WooCommerce 8.0 or higher
  • PHP 7.4 or higher
  • WooCommerce geolocation enabled (WooCommerce > Settings > General > Default customer location)

Do you like Country Based Content?

A review on wordpress.org helps other store owners find it: leave a review. Thank you.

External services

This plugin makes no remote request itself. It asks WooCommerce’s geolocation for the visitor’s country and allows WooCommerce to use the services below, which it contacts only when neither a country header sent by your host or CDN nor WooCommerce’s MaxMind GeoLite2 database gives the country. To keep detection on your server, enter a MaxMind license key in WooCommerce Settings Integration MaxMind Geolocation: WooCommerce then downloads the database and keeps it up to date.

Country lookup of the visitor’s IP address

WooCommerce sends the visitor’s IP address to one of these services, picked at random, and tries the other if it gets no answer. The request is made by your server and carries the IP address and a User-Agent header naming WooCommerce and its version (for example WooCommerce/11.1.2). WooCommerce keeps the answer for one day, in a transient named after the IP address.

Public IP address of your server

Only if the country still cannot be found, typically on a local test site, WooCommerce asks one of these services for your server’s own public IP address and looks up the country of that address instead, so the services above then receive your server’s address. These four receive no visitor data.

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums