Title: Codefaeries Country Based Content
Author: Long Watch Studio - Code Faeries
Published: <strong>ޖޫން 25, 2026</strong>
Last modified: އޮކްޓޯބަރ 5, 2026

---

Search plugins

![](https://ps.w.org/codefaeries-country-based-content/assets/banner-772x250.png?
rev=3586272)

![](https://ps.w.org/codefaeries-country-based-content/assets/icon-256x256.png?rev
=3586272)

# Codefaeries Country Based Content

 By [Long Watch Studio – Code Faeries](https://profiles.wordpress.org/lwsdevelopers/)

[Download](https://downloads.wordpress.org/plugin/codefaeries-country-based-content.1.4.2.zip)

 * [Details](https://dv.wordpress.org/plugins/codefaeries-country-based-content/#description)
 * [Reviews](https://dv.wordpress.org/plugins/codefaeries-country-based-content/#reviews)
 *  [Installation](https://dv.wordpress.org/plugins/codefaeries-country-based-content/#installation)
 * [Development](https://dv.wordpress.org/plugins/codefaeries-country-based-content/#developers)

 [Support](https://wordpress.org/support/plugin/codefaeries-country-based-content/)

## Description

**Country Based Content** lets you adapt your **WooCommerce** store to each visitor’s
country. Redirect visitors, hide prices or the add-to-cart button, and adjust prices,
all based on the country detected by WooCommerce’s geolocation.

#### Key Benefits

 * **Local geolocation** — Uses WooCommerce’s MaxMind GeoLite2 database. When it
   resolves the visitor’s address, detection stays on your server: no external API
   call, no data sent to third parties. Otherwise WooCommerce may fall back to an
   external service (see “External services”).
 * **Applies at checkout** — Price adjustments modify the actual product price, 
   so customers pay the adjusted amount throughout the cart and checkout.
 * **Role exemptions** — Exempt logged-in users or specific roles so administrators
   and shop managers always see the real store.
 * **Bot-friendly** — Search engine and ad-platform crawlers can be exempted from
   redirections so advertising campaign verification is not affected.
 * **Clean, modular code** — Loads only the features you enable.

#### Features

**Country-Based Redirections**
 Automatically redirect visitors to specific URLs
based on their detected country. Useful for:

 * Directing customers to regional stores
 * Complying with local regulations (GDPR notices, age restrictions)
 * Creating market-specific landing pages

**Content Visibility Rules**
 Control what WooCommerce content visitors can see:

 * **Hide Prices** — Remove price display for specific countries
 * **Hide Add-to-Cart** — Prevent purchases while keeping products visible
 * Target all products, specific categories, or individual products

**Price Adjustments**
 Modify prices based on visitor location:

 * Apply percentage increases or decreases
 * Add or subtract fixed amounts
 * Set entirely different prices per country
 * Adjustments apply at checkout, not just on display

**Testing & Developer Tools**

 * Test simulator on each rules screen to preview which rule would match
 * “Force Country” developer tool to simulate visits from any country

#### Pro Features

The Pro version unlocks the full potential:

**Payment & Shipping Restrictions** _(New in 1.2.0)_
 Control checkout options by
country:

 * Restrict payment methods (hide PayPal for certain countries, show local payment
   options)
 * Restrict shipping methods (disable international shipping, show local carriers)
 * Create country groups for easier management

**Currency Conversion**
 Display prices in visitor’s local currency:

 * Automatic exchange rates (ECB reference rates, fetched from the third-party Frankfurter
   API when Auto-Fetch Rates is enabled, daily by default)
 * 30+ currencies supported
 * Manual rate override option
 * Smart rounding rules

**Content Shortcode**
 Display conditional content anywhere with `[cbc_content]`:

    ```
    [cbc_content countries="FR,BE,CH"]
    Free shipping to France, Belgium, and Switzerland!
    [/cbc_content]

    [cbc_content countries="US" match="exclude"]
    International shipping rates apply.
    [/cbc_content]
    ```

**State/Region Targeting**
 Go beyond countries — target specific states or regions:

 * US states (CA, TX, NY…)
 * Canadian provinces (QC, ON, BC…)
 * German Länder, Australian states, and more
 * Use in shortcodes: `[cbc_content regions="US:CA,US:TX"]`

**Additional Pro Features**

 * Hide products completely from catalog and search
 * Display alternative content (“Not available in your region”)
 * Tax message display by country
 * Priority support

[Get the Pro Version](https://codefaeries.com/product/country-based-content/)

#### How It Works

The plugin makes no remote request itself: country detection is done by WooCommerce’s
geolocation. When WooCommerce’s MaxMind GeoLite2 database resolves a visitor’s address,
this means:

 * **No external API calls** — Detection happens locally on your server
 * **No data sent to third parties**
 * **Fast and reliable** — No dependency on external services
 * **99%+ accuracy** at the country level

If that database is not installed (WooCommerce downloads it only once a MaxMind 
license key is entered) or cannot resolve an address, and your host or CDN does 
not send a country header, WooCommerce falls back to an external geolocation service,
which receives the visitor’s IP address. To keep detection on your server, enter
a MaxMind license key in WooCommerce  Settings  Integration  MaxMind Geolocation.
See “External services” for the services concerned.

#### Requirements

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

### 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.

 * ipinfo.io: [terms of service](https://ipinfo.io/terms-of-service), [privacy policy](https://ipinfo.io/privacy-policy).
 * api.country.is (WooCommerce 11 and later): [service page](https://country.is/).
 * ip-api.com (WooCommerce 10 and earlier, over plain HTTP): [terms of service and privacy policy](https://ip-api.com/docs/legal).

#### 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.

 * ipify.org: [service page](https://www.ipify.org/).
 * ipecho.net: [service page](https://ipecho.net/developers.html).
 * ident.me and tnedi.me (a mirror of ident.me): [privacy statement](https://api.ident.me/#privacy-logging).

## Installation

 1. Upload the plugin files to `/wp-content/plugins/codefaeries-country-based-content/`
    or install directly through the WordPress plugins screen
 2. Activate the plugin through the ‘Plugins’ screen in WordPress
 3. Ensure WooCommerce is installed and activated
 4. **Important:** Enable WooCommerce geolocation:
 5.  * Go to WooCommerce  Settings  General
     * Set “Default customer location” to “Geolocate” or “Geolocate (with page caching
       support)”
 6. Navigate to WooCommerce  Country Based Content to configure the plugin
 7. Enable desired features in the “Features & Settings” tab
 8. Create your rules in the respective tabs

## FAQ

### How does country detection work?

Country detection is done by WooCommerce’s geolocation. When WooCommerce’s MaxMind
GeoLite2 database resolves the address, detection happens locally on your server
with no external API calls, making it fast, reliable, and privacy-friendly. If the
database is not installed or cannot resolve the address, WooCommerce may fall back
to an external service (see “How It Works” and “External services”).

### How accurate is the geolocation?

Country-level detection is typically 99%+ accurate. Users with VPNs or corporate
proxies may be detected in a different location.

### Does this affect actual checkout prices?

Yes. Price adjustment rules modify the actual product price, so customers pay the
adjusted price at checkout. This ensures price consistency throughout the shopping
experience.

### Does this work with page caching?

Yes. The plugin is designed to work with page caching. For best results, use WooCommerce’s“
Geolocate (with page caching support)” option.

### Can I test rules without affecting real visitors?

Yes. Use the “Force Country” option in Developer Tools to simulate visits from any
country. You can also use the Test Simulator on each rules page to preview which
rules would apply.

### What happens if a visitor uses a VPN?

The visitor will be detected based on their VPN exit location. Consider using the“
Exempt logged-in users” option so registered customers always see accurate information.

### Will redirections break my advertising campaigns?

No. The “Exempt bots and crawlers” option (enabled by default) prevents redirections
for search engine and ad-platform crawlers, so campaign verification works as expected.

### Is it privacy friendly?

Yes, when WooCommerce’s MaxMind GeoLite2 database resolves the visitor’s address:
the IP address is then used on your server only. The plugin itself does not store
personal data and makes no remote request. If the database is not installed or cannot
resolve the address, WooCommerce may send the IP address to an external geolocation
service (see “External services”).

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Codefaeries Country Based Content” is open source software. The following people
have contributed to this plugin.

Contributors

 *   [ Long Watch Studio – Code Faeries ](https://profiles.wordpress.org/lwsdevelopers/)

[Translate “Codefaeries Country Based Content” into your language.](https://translate.wordpress.org/projects/wp-plugins/codefaeries-country-based-content)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/codefaeries-country-based-content/),
check out the [SVN repository](https://plugins.svn.wordpress.org/codefaeries-country-based-content/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/codefaeries-country-based-content/)
by [RSS](https://plugins.trac.wordpress.org/log/codefaeries-country-based-content/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.4.2 – 2026-10-05

 * Compatibility: the admin header shows the licence status reported by Country 
   Based Content Pro 1.4.2.

#### 1.4.1 – 2026-10-05

 * New: a redirection rule can target a source pattern, a path on this site where*
   matches any characters, and reuse the matches in its target with $1, $2.
 * New: a General setting chooses whether several matching price rules add up in
   priority order (the former behaviour) or only the highest-priority rule applies.
 * Fixed: the content and redirect simulators report the same exemptions the storefront
   applies, and a product-scoped content rule matches the tested product.
 * Fixed: the Danger Zone uninstall removes every option the plugin writes.
 * Fixed: the tip and warning callouts of the General screen get a box of their 
   own.
 * Improved: the free edition announces no rule-count limit: it never had one.
 * Improved: the readme states when country detection can send the visitor’s IP 
   address to an external service through WooCommerce, and names the exchange-rate
   source.
 * Improved: the bundled admin toolkit is updated and now ships without its telemetry
   and licensing code.
 * Compatibility: tested up to WordPress 7.1.

#### 1.3.1

 * Initial public release on WordPress.org
 * Country-based redirection rules with bot and crawler exemption
 * Content visibility rules (hide price, hide add-to-cart) targeting all products,
   categories or specific products
 * Price adjustment rules (percentage, fixed amount, set price) applied at checkout
 * User exemptions by role and for logged-in users
 * Test simulator on every rules screen
 * Developer tools to force a country for testing

## Meta

 *  Version **1.4.2**
 *  Last updated **3 weeks ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.0 or higher **
 *  Tested up to **7.1.3**
 *  PHP version ** 7.4 or higher **
 *  Language
 * [English (US)](https://wordpress.org/plugins/codefaeries-country-based-content/)
 * Tags
 * [country](https://dv.wordpress.org/plugins/tags/country/)[geolocation](https://dv.wordpress.org/plugins/tags/geolocation/)
   [prices](https://dv.wordpress.org/plugins/tags/prices/)[redirect](https://dv.wordpress.org/plugins/tags/redirect/)
   [woocommerce](https://dv.wordpress.org/plugins/tags/woocommerce/)
 *  [Advanced View](https://dv.wordpress.org/plugins/codefaeries-country-based-content/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/codefaeries-country-based-content/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/codefaeries-country-based-content/reviews/)

## Contributors

 *   [ Long Watch Studio – Code Faeries ](https://profiles.wordpress.org/lwsdevelopers/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/codefaeries-country-based-content/)