
Certainly! With our geolocation Dynamic Keyword Insertion (DKI) shortcode, you can effortlessly achieve this.
For instance, if you want to showcase the user’s country, you can use the following shortcode:
[ifsoDKI type='geo' show='country']
Similar shortcodes are available to display the user’s country flag, state, city, and event time calculated based on the user’s timezone.
Nope, you don’t need the Pro version of If-So to make use of the geolocation service.
The geolocation condition comes with the free version of the plugin, and you get 250 monthly sessions with our premium IP-to-location API for accurate results (for lifetime).
If your website requires additional sessions, you can opt for one of our geolocation plans.
You don’t have to buy a Pro license along with a geolocation plan if you only want to use the geolocation condition.
We strive for maximum accuracy by utilizing a premium, highly accurate IP-to-location API.
However, it’s important to note that no geolocation service can guarantee 100% accuracy. Several factors influence the accuracy of the location data, with the ISP of the IP address being a key factor. Accuracy is generally higher for fixed lines than it is for cellular networks.
If you come across any inaccuracies, please report them to us, and we will ensure that the database is updated accordingly.
Gain a deeper understanding of IP-based geolocation services and their operational principles
If-So utilizes the ipinfo.io premium IP-to-location API for geolocation-based content. This database has shown high accuracy compared to similar databases.
The database is regularly updated to ensure the most up-to-date information. If you come across any inaccuracies, please report them to us, and we will ensure that the database is updated accordingly.
We also have plans to introduce at least one additional option for geolocation services in the future. This will allow you to switch between different options based on your preferences and requirements.
Absolutely! You can implement a manual user location selection form (location override) that empowers users to choose a different location than the one automatically detected by our IP-to-location service.
Dynamic content will be displayed based on the user’s selection.
For additional information, please refer to our detailed guide.
No, there’s no need to disable the geolocation service. The geolocation functionality will only be active if you set up location-based content.
A geolocation session refers to the period of time starting from when a visitor accesses a page with a geolocation trigger until either the visitor closes the browser or remains inactive for 25 minutes (the duration may slightly vary depending on the user’s browser and server hosting the website).
To illustrate, if a visitor lands on the homepage, navigates to multiple other pages, and eventually leaves, this activity will be counted as a single session.
The table below illustrates how different visitor interactions impact the session count on a website with geotargeted content:
| Scenario | Session Count |
|---|---|
| A visitor only views pages without geotargeted content and then leaves | 0 |
| A visitor views a page with conditional content, the geolocation condition is not one of the conditions (other If-So conditions are used). | 0 |
| A visitor browses multiple pages within a single session | 1 |
| A visitor visits a page with geotargeted content, and then refreshes the page | 1 |
| A visitor views a page, closes the tab, and returns to the site after 15 minutes | 1 |
| A visitor views a page with geotargeted content, but their location doesn’t match any targeted locations (default content is shown). *The user’s location still needs to be checked in this case. | 1 |
Nope!
A geolocation session will only be counted if a user visits a page with a geolocation-based trigger.
Moreover, if a user visits more than one page containing a geolocation trigger during the same visit, If-So will only count it as one session.
If you deplete your geolocation sessions, If-So will bypass the geolocation condition and evaluate the condition of the subsequent content version. If all dynamic versions have a geolocation condition or if none of the conditions are met, the default version will be displayed.
If you are utilizing our Geolocation DKI shortcodes, you can establish a fallback value to be shown in such instances. Just include the parameter fallback=”your-value” to the trigger shortcode.
[ifsoDKI type=”geo” show=”country” fallback=”your-value”]
Yes! You can prevent logged-in users from using geolocation sessions by adding the following code to your functions.php file:
phpCopyEditadd_filter('ifso_exclude_from_geo', function($exclude) {
if (is_user_logged_in())
$exclude['blockme'] = true;
return $exclude;
});
This ensures that logged-in users won’t consume geolocation sessions, helping you optimize usage for other visitors.
Yes, you can. You have the option to either activate the automated “Bots Block” mode or log geolocation requests and manually block specific IPs. Learn more.
You can check your monthly session quota in two locations:
Screenshot – The geolocation dashboard:

Screenshot – Your account:

No, a geolocation license is sufficient if you only want to use the geolocation service.
Absolutely! There are no limitations on the number of domains where you can activate a geolocation license.
Certainly not!
Yes. To determine the user’s location for deciding whether to display geotargeted content, we need to check the user’s location. As a result, a session will be counted irrespective of whether the geotargeting condition is met or not.
Absolutely! You have the flexibility to upgrade your existing license at any time.
The session limit applies to the total number of sessions across all websites where the license is active.
Yes, we do!
When you purchase an annual Geo Super Plan (100,000 monthly sessions), you’ll have the ability to easily upgrade your package.
Additional packages of 50,000 monthly sessions are offered at a rate of $12.50 per month on a yearly subscription basis. You have the flexibility to purchase as many packages as you need to meet your specific requirements.
If your redirect doesn’t fire immediately, the issue is usually related to how the trigger is loaded. Here’s how to ensure the redirect runs as quickly and smoothly as possible:
When a trigger loads with Ajax, the dynamic content is fetched after the static part of the page has already loaded from the cache. This means the redirect can only occur once the Ajax request finishes — resulting in a short delay.
Strong caching paired with inefficient site construction can cause redirects to feel slower.
To make the redirect fire instantly:
If you have set up a geotargeted content and it doesn’t seem to be working as expected, follow the troubleshooting steps below. Each step covers a common issue and how to verify it.
The geolocation condition uses an external API to identify the visitor’s location. It can only work on a live, publicly accessible website. Local or internal environments do not support IP-to-location lookups.
If it shows 0/0, it usually means your server cannot reach our geolocation service.
Please fill out this form and our support team will take it from there.

If-So’s geolocation condition may not take action when browsing the site through some VPNs. If you don’t see the geo-targeted version, it doesn’t necessarily mean the condition isn’t working properly.
Instead, try:
Caching shows visitors a pre-rendered version of the page. If you use a caching plugin, server cache, CDN, or any type of page caching, enable If-So’s Page Caching Compatibility option to ensure your geotargeted content loads via Ajax after the cached page is served.
Elementor users:
In adittion to the steps above, go to Elementor → Settings → Performance (tab) → Change the Element Cache to Disable, and let me know if it solves the problem.
For a deeper explanation of page caching and If-So’s caching compatibility.
No IP-to-location service is 100%. The accuracy of a location depends on many factors, the most important being the ISP of the address. The accuracy is generally higher for fixed lines than it is for cellular networks. Learn more here about geolocation accuracy.
Below is how If-So recognizes your location. If you have set up a trigger targeting your actual location but the detected value is incorrect, the dynamic version will not be displayed as expected.
Continent:
Country:
State:
City:
Timezone:
Do you see the correct location in the above list?
✅ Yes → Double-check that your dynamic content is being loaded via Ajax (see the step above).
❌ No → Check out the three options below:
Unlike other If-So conditions, geolocation usage is limited by monthly sessions. If you run out of credits, the default content (fallback content) will be displayed instead of the geotargeted version.
To view your monthly session usage, go to If-So → Geolocation in your WordPress dashboard.
From time to time we encounter conflicts between our geolocation service and Cloudflare. We can solve them! Paste the following code at the end of your functions.php file and try again. If it doesn’t solve the problem, please contact our support.
add_filter('ifso_user_ip',function(){
$ip = null;
if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) //Cloudflare
$ip = $_SERVER['HTTP_CF_CONNECTING_IP'];
elseif (!empty($_SERVER['HTTP_CLIENT_IP']))
$ip = $_SERVER['HTTP_CLIENT_IP'];
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR']))
$ip = explode(',',$_SERVER['HTTP_X_FORWARDED_FOR'])[0];
else
$ip = $_SERVER['REMOTE_ADDR'];
if(!empty($ip)){
$ip = explode(':',$ip)[0];
}
return $ip;
});
It appears that there is a communication issue between our server and yours. No need to worry though, we can resolve it. Kindly follow these two steps:
Stay calm and refer to our Geolocation Troubleshooting guide for assistance.
Inaccurate session counts can occur when bots visit the website. Learn about possible solutions to address this issue.
If you are unable to see the country flags, it is likely because your browser does not support emoji display by default (Google Chrome on a desktop for example).
If your conditional redirect isn’t working as expected, don’t worry – follow the steps below to identify the issue and get it resolved quickly.
Paste the redirect shortcode directly into the main content field of a new test page (without using a trigger).
Did it work?
✅ Yes → The redirect code works. Move on to checking your condition.
❌ No → The issue is likely with the redirect setup. Jump to the “Redirect shortcode issues” section.
Does it work?
✅ Yes → If you the correct version the issue is either the redirect type or a caching issue.
❌ No → If you don’t see the correct version → The condition may be misconfigured, or caching is preventing the dynamic version from loading.
Works? The issue is likely related to the redirect shortcode itself, or a caching conflict.
❌ Didn’t work? The condition may be misconfigured or the content might be blocked by caching.
Caching is the most common reason redirects don’t fire as expected.
[ifso-redirect url='https://example.com' type='js']
If JavaScript redirection works, the issue is almost certainly caching-related.
Try loading the content with and without Ajax (Page Caching Compatibility) to determine if caching is interfering. How to enable/make sure the Ajax loading is enabled.
If the issue persists, please contact our support and share the following:
We’re happy to take a look and help troubleshoot further. Contact support
If-So utilizes an IP-to-location database to determine the user’s location. You can use the geo data detected by If-So for any purpose by implementing the following code:
require_once(IFSO_PLUGIN_BASE_DIR. 'services/geolocation-service/geolocation-service.class.php');
$geo_data = \IfSo\Services\GeolocationService\GeolocationService::get_instance()->get_user_location();
Keep in mind that IP-to-location services (any service, not just ours) are not always 100% accurate. Learn more about IP-to-location services and how they work.
Want to capture the user’s location using JavaScript? Click here
Yes, you can capture the user’s country in JavaScript by using the following PHP code in your theme’s functions.php file. This code fetches the user’s geolocation data and sets it as a JavaScript variable:
phpCopy codeadd_action('wp_enqueue_scripts', function(){
if(!defined('IFSO_PLUGIN_BASE_DIR')) return;
require_once(IFSO_PLUGIN_BASE_DIR. 'services/geolocation-service/geolocation-service.class.php');
$geo_data = \IfSo\Services\GeolocationService\GeolocationService::get_instance()->get_user_location();
$ifso_country = !empty($geo_data->get('countryCode')) ? $geo_data->get('countryCode') : '';
if(function_exists('wp_add_inline_script'))
wp_add_inline_script('if-so',"var ifso_country = '{$ifso_country}';",'after');
});
This code will make the user’s country available as a variable named ifso_country in your JavaScript. You can customize this code to capture other geolocation data, such as city or state, by adjusting the values in the code.