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. Open a page in the WordPress Editor, then open Conditional Blocks and go the settings tab.
  4. Paste & Verify that the API key is valid.
  5. Add the Geolocation – Country condition to a content block, and choose the specific country.
  6. 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.

Was this page helpful?