Simple WordPress Geo Redirect.

Quickly set up geo redirects to send visitors by continent, country, state, city, or timezone.

How does the geo redirect work

The plugin detects the visitor’s location and redirects them when the rules match.

The plugin detects the visitor’s location and redirects them when the rules match.

It only takes a minute to set up: simply select the locations and set your geo redirect using our shortcode generator.

Use cases

Here are some common ways to use geo redirects on your site:

  • Redirect visitors from a global WordPress site (for example.com) to a local domain such as .co.uk or .com.au.
  • Send visitors to location-specific landing pages in their own language.
  • Redirect users to the nearest branch, office, or service page based on their location.
  • Route traffic by country, state, city, or timezone for pricing, shipping, or legal variations.
  • Use geo redirects as part of an advanced WordPress geo redirect setup with A/B testing or other dynamic conditions.

Geo Redirection options

Redirection types

There are three types of redirects you can use when creating a WordPress geo redirect:

  • JavaScript redirect (default option) Compatible with Ajax-loaded triggers and most caching setups. In most popular browsers, the referrer source is passed to the target page.
  • 301 (permanent) redirect – Use a 301 redirect when you want a long-term redirect.
  • 302 (temporary) redirect – Use a 302 redirect for temporary changes such as seasonal campaigns, tests, or maintenance pages.

Note: 301 and 302 redirects are PHP-based and cannot run when the trigger is loaded with Ajax. If you are using Ajax loading, either add ajax="no" to the trigger shortcode or use a JavaScript redirect instead.

Redirect once per user

This option works by giving the redirect a name and adding the do_once_per parameter. The value of do_once_per can be either the word session (to prevent the redirect for the entire browser session) or a numeric value that represents the number of seconds during which the redirect should not occur again.

Example:

[ifso-redirect url="https://example.com" code="301" name="geo-redirect-example" do_once_per="86400"]

In this example, the visitor will be redirected to https://example.com once every 24 hours (86,400 seconds). If they visit the page again within that time, the redirect will not run.

The “Redirect once per user” option relies on a cookie to work. The cookie name is based on the name you assign to your redirect, starting with ‘ifso-rdr-‘ followed by your chosen name (i.e., ifso-rdr-yourname).

Geo Redirect Templates

A simple setup to redirect users from any page on your WordPress site to an equivalent page on a parallel website.

  • Redirect users from a .com/pageX to a .co.uk/pageX
  • Redirect users from a .com/pageX to .com/uk/pageX

.com .co.uk

WordPress Geo Redirect template

.com/… .com/uk/…

WordPress Geo Redirect Template permalink

Click here to learn more about Geolocation Redirect Templates.

Step-by-step: how to set up a geo redirect

The setup involves two steps: (1) creating a trigger with a geolocation condition, and (2) adding a redirect shortcode that sends matching visitors to the target URL.

  1. Download and activate the If-So Dynamic Content WordPress plugin.
  2. On your WordPress dashboard, go to If-SoAdd New Trigger. Screenshot
  3. In Version A, select the Geolocation condition and choose the continent, country, state, city, or timezone you want to target. Screenshot
  4. Click the If-So shortcodes button above the content field and select Redirect. Screenshot
  5. Enter the redirect URL and the rest of the redirection options.
  6. Leave the Default version empty if you do not want any action when the condition is not met.
  7. Click Publish and paste the trigger’s shortcode as high as possible on the page you want to redirect from.

Screenshots

Cretae a new trigger
Cretae a new trigger
Select location
Select location
Set up the geo redirect
Set up the geo redirect

Troubleshooting

  • Redirect feels slow or delayed

    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:

    Why Ajax affects redirect speed

    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.

    How to speed it up

    To make the redirect fire instantly:

    1. Make sure to load the trigger without Ajax. The best practice is to add the parameter ajax=”no” to the trigger’s shortcode so that even if you change the Ajax settings on your site in the future, the trigger with the redirection will not be affected.

      Disabling Ajax means the page must be excluded from caching, so weigh this decision based on SEO needs, performance, your specific use case, and how well the page performs without caching
    2. Use a 301 or 302 redirect (and not a JS redirect).
    3. Consider embedding the If-So trigger to the page using a PHP code directly in the page template.
  • Conditional redirect not working

    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.

    1. Isolate the problem

    Test the redirect outside the trigger

    Paste the redirect shortcode directly into the main content field of a new test page (without using a trigger).

    1. Create a new blank test page.
    2. Paste the redirect shortcode directly in the main content area (without using a trigger or dynamic content).
    3. Visit the page and see whether the redirect works.

    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.

    Verify that the condition is being met

    1. In your trigger (or dynamic content block), add a simple text indicator before the redirect — e.g., “This is a version A”.
    2. Add a text indicator to the default version — e.g., “This is the default version.”
    3. Visit the page in an incognito window (to avoid admin/existing-cookie interference).

    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.

    2. Check caching settings

    Caching is the most common reason redirects don’t fire as expected.

    1. Try loading the trigger with and without Ajax (Page Caching Compatibility) to determine if caching is interfering. How to enable/make sure the Ajax loading is enabled.
    2. Try switching to a JavaScript redirect by adding the parameter type=’js’ to your redirection shortcode. For example:
    [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. 

    Still not working? We’ll help!

    If the issue persists, please contact our support and share the following:

    • Where the redirect is placed (page, trigger, element, popup, etc.).
    • Which condition you’re using.
    • Whether the redirect works on a blank test page.

    We’re happy to take a look and help troubleshoot further. Contact support

Was this Helpful ?

    We're sorry couldn’t be more helpful ☹️

      Ready to get started?
      Try it on your website