Skip to main content

Advanced settings

WooCommerce > MHM Currency > Advanced

This tab holds four settings.

Geolocation detection

SettingWhat it does
Enable geolocation-based currency detectionDetects the visitor's country and shows the matching currency

Country detection tries two sources, in order, and neither one sends anything about the visitor off your server (exchange rates are a separate matter — see Automatic rate updates below):

  1. CloudFlare (primary) — if your site is behind CloudFlare, the country code is read from the CF-IPCountry header. No configuration needed, and fast. Unknown-country and Tor exit-node codes are ignored.
  2. Local MaxMind database (fallback) — if there's no CloudFlare header, WooCommerce's MaxMind GeoIP database file, stored on your own server, is queried instead. This needs a free license key entered under WooCommerce > Settings > Integration > MaxMind Geolocation.

If neither is available: detection finds nothing, and the visitor sees the base currency until they pick one themselves. No third party is asked. The Advanced tab says this directly under the setting, whether the setting is on or off.

Changed in 2.2.0. Earlier versions called WooCommerce's geolocate_ip() with its default arguments. On a store with no MaxMind database, that sent every new visitor's IP address to a remote geolocation service. 2.2.0 closes that fallback. If you relied on geolocation without CloudFlare or a MaxMind database, it now finds nothing — add a free MaxMind license key to bring it back. WooCommerce downloads the database file from MaxMind and refreshes it on a schedule; that request carries your license key, never a visitor's address, and every lookup after that happens on your own server.

Setting up the MaxMind database (free):

  1. Create a MaxMind account and complete the GeoLite2 signup.
  2. Generate a license key under Manage License Keys.
  3. Paste the key into WooCommerce > Settings > Integration > MaxMind Geolocation and save.
  4. WooCommerce downloads the database into a woocommerce_uploads/ folder inside your site's uploads directory — on a standard single site that's wp-content/uploads/woocommerce_uploads/; on a multisite subsite, or when the uploads location has been customized, it's that site's own uploads directory instead. The file name starts with an unpredictable prefix on purpose, so its address can't be guessed from outside — don't look for it at the root of the uploads directory.

How it works:

  1. Detection runs only when the visitor has no currency cookie yet.
  2. The country code maps to a currency.
  3. If that currency isn't enabled in your store, detection is treated as a miss and the base currency is used.
  4. On a successful detection, a cookie is written so detection doesn't run again on later pages.
  5. If the visitor picks a different currency from the switcher, that choice is saved to the cookie and takes priority over geolocation from then on.

Automatic rate updates

Rates can update automatically via WordPress's scheduled-task system (WP-Cron).

OptionEffect
Manual onlyNo automatic updates; the scheduled task is removed
HourlyUpdates once an hour
Twice dailyUpdates twice a day
DailyUpdates once a day

Changing the interval clears the existing scheduled task and reschedules it. Deactivating the plugin removes the task entirely.

WP-Cron isn't a real system cron — it only fires on incoming traffic. On a low-traffic site, point your server's crontab at wp-cron.php so updates keep running on schedule.

Rate sources need no API key, so this tab has no provider selector or key field.

Cache compatibility mode

Since 1.1.0.

A page cache stores the HTML your server produced for whoever asked first. When prices are converted on the server, that means the first visitor's currency is what every later visitor is served.

Cache compatibility mode, on by default, avoids this: for logged-out visitors, every front-end page except the cart, checkout and account pages — shop, category and product pages included — is always rendered in your base currency, so the same cached page is correct for everyone. The browser then converts the displayed prices, after the page loads, through a request to this plugin. If a theme or plugin defines WooCommerce's cart constant on every page, this no longer applies — the plugin warns you in the admin; see the FAQ.

The split is deliberate: only displayed prices are converted in the browser. Cart, checkout, order totals, order emails and the WooCommerce REST API are always calculated on the server, in the currency the customer actually chose — so the amount charged can't be altered from the browser.

SettingWhat it does
Cache pages in the base currencyTurning this off converts prices on the server again, as before 1.1.0 — which doesn't play well with a page-caching plugin. Cart, checkout and order totals are always converted on the server either way.

Turning the mode off doesn't restore 1.0.0 behaviour exactly — the admin, REST API and scheduled-task fixes stay active in both modes.

What happens when the plugin is removed

Since 1.3.0.

SettingWhat it does
Delete all data when the plugin is removedOff by default. Left off, your settings and the currency and exchange rate recorded on each order stay in place when the plugin is deleted.

Those per-order records are the only basis for multi-currency sales history and cannot be rebuilt afterwards, which is why the destructive choice is the one you have to make deliberately rather than the one that happens by default. Deactivating the plugin never deletes anything; only deleting it does, and only with this switch on.

On a multisite network the switch clears the site the plugin is removed from.

The full FAQ is on the FAQ page; the full list of known limits is on the Known limits page.