1. Documentation /
  2. MaxMind Geolocation Integration

MaxMind Geolocation Integration

WooCommerce allows shop owners to automatically geolocate customers and display tax rates and shipping methods specific to a customer’s location. In order to determine the correct location for a customer, as of version 3.9+, WooCommerce uses an integration with MaxMind Geolocation.

This document covers:

  • Enabling the geolocation in the settings
  • Creating a MaxMind account
  • Generating a MaxMind license key
  • Adding the MaxMind license key to your site’s settings.
  • How your WooCommerce site updates the MaxMind database used for geolocation

Enabling Geolocation

↑ Back to top

To enable the MaxMind Geolocation Integration:

  1. Go to: WooCommerce  > Settings > General
  2. Head to the General options section.
  3. In the “Default customer address” dropdown, choose “Geolocate” or “Geolocate (with page caching support)”

After geolocation is enabled, you need to create a MaxMind account and finish configuring the MaxMind Geolocation in the integrations tab in the WooCommerce settings.

Create an account on MaxMind

↑ Back to top
  1. Visit the GeoLite2 Sign Up page
  2. On the registration page, complete the form with your information. If you’re not sure what to choose as “Industry” and “Intended use” fields you can fill as “eCommerce” and “Content customization” respectively.
  3. After submitting you’ll get an email with a link to set your password shortly. Click on that link and choose a password.

Create a MaxMind License Key

↑ Back to top

Now that you have an account on the MaxMind website you will be able to create a license key.

  1. Go to: https://www.maxmind.com/en/account
  2. Select the “Manage License Keys” tab in your user account dashboard.
  3. Select “Generate new license key”.
MaxMind license keys page
  1. Next, fill in the form to generate a license key.
  2. Add a description (just as the name of your store)
  3. Choose “No” next to “Will this key be used for GeoIP Update?”
  4. Select “Confirm”.
MaxMind confirm license key page
  1. You will be presented with a new key. Copy this key straight away as it will be shown only once.
MaxMind license key created page
Note: While you can only generate 25 license keys on MaxMind, it seems that the same license can be used on multiple sites.

Add MaxMind Geolocation License Key to WooCommerce settings

↑ Back to top

Finally, you need to add this key to your WooCommerce settings.

  1. Go to: WooCommerce > Settings > Integration > MaxMind Geolocation
  2. Paste the license key
  3. Click the“Save changes” button

Now your WooCommerce store is ready to geolocate customers with the MaxMind Geolocation Integration.

Updating the MaxMind database

↑ Back to top
  • The system automatically updates every 15 days, using the built-in WordPress function WP Cron to trigger woocommerce_geoip_updater.
  • If the mmdb file on your server doesn’t seem to be updated correctly after this time, you can install the WP Crontrol plugin to troubleshoot scheduled cron events in WordPress.
  • Once the plugin is installed and active, you can go to Tools > Cron Events, check the next scheduled time for this event, and optionally run it manually.

Why am I seeing ?v=$hash query strings added to my site’s URLs? (e.g. https://my.example.shop/?v=bc74b2d76824)

When you select the option to “Geolocate (with page caching support)” WooCommerce appends a user specific hash of the user’s IP address to the URL, so that the page can be cached for their re-use. This enables location specific data like tax rates and shipping information to be cached for your customers as they navigate your shop.

If you’d like to prevent these query strings from being added. Select the Geolocate option instead.

Questions and Support

↑ Back to top

Do you still have questions and need assistance? 

This documentation is about the free, core WooCommerce plugin for which support is provided in our community forums on WordPress.org. Searching there you’ll often find that your question has been asked and answered before.

If you haven’t created a WordPress.org account to use the forums, here’s how.

  • If you’re looking to extend the core functionality shown here, we recommend reviewing available extensions in the Woo Marketplace.
  • Need ongoing advanced support, or a customization built for WooCommerce? Hire a WooExpert agency.
  • Are you a developer building your own WooCommerce integration or extension? Check our Developer Resources.

If you weren’t able to find the information you need, please use the feedback thumbs below to let us know! 🙏