Geolocation

The Geolocation features use an external API to correctly detect the user location. WordPress cannot accurately detect the location on its own, however we’ve made it simple by using services provided by IPInfo.io.

https://ipinfo.io/ has a generous free tier with 50,000 lookups per month.

How to get started

Assuming you’ve already purchased and setup Conditional Blocks Pro on your WordPress site, then there’s only a few steps left before you can use one of the below Geolocation conditions.

  1. Signup for your free API Key from https://ipinfo.io
  2. Copy the API key
  3. Secure your API key usage by whitelisting your domain name & server IP address.
  4. Open a page in the WordPress Editor, then open Conditional Blocks and go the settings tab.
  5. Paste & Verify that the API key is valid.
  6. Add the Geolocation – Country condition to a content block, and choose the specific country.
  7. That’s It!
Screenshot form the IPinfo website
Screenshot of where to insert the IPinfo API token in Conditional Blocks

Developing WordPress locally?
Local development site won’t detect your IP address correctly. You are WordPress site needs to be online for you to test geolocation features correctly.

FAQ

How many API requests does the feature use?

The IPinfo.io API will only be triggered once on the pages where you the Geolocation conditions.

In other words, 1 visitor = 1 API lookup on pages with Geolocation conditions.

The API lookup will only happen once, even if you use multiple geolocation check on the same page.

My Token is verified but Geolocation conditions aren’t working

There could be two reasons why your blocks are not displaying as they should.

  • Firstly make sure you are using live website (not local on your computer).
  • Double check your security settings in IpInfo.io include the domain of your website & the server IP address.
Was this page helpful?