Deal ends in:

Autumn Sale! UP TO 40% OFF!
GET IT NOW

How to Display Content Based on Location in WordPress?

Two simple steps, no coding, about two minutes.

This page covers how to display content based on visitor location in WordPress with If-So – creating a trigger with a geolocation condition, setting the content and the default version, adding it to the page with Gutenberg, Elementor, or a shortcode, understanding the monthly session limit, and confirming it works.


For a feature overview, see the Location-Based Content feature page →

Step-by-step: How to set up location-based content?

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 plugin.
  2. On your WordPress dashboard, go to If-So → Add New Trigger. Screenshot
  3. In version A, select the geolocation condition and choose the locations you want to target. Screenshot
  4. In the version A content field, enter the content that will be displayed when the visitor’s location matches your targeting. Screenshot
  5. In the default content field, enter the content to display when the visitor’s location does not match any of your targeted locations. Leave this field empty if you prefer not to show anything in these cases. Screenshot
  6. Click Publish and paste the shortcode generated by If-So anywhere on your website where you want the content to appear. Screenshot
  1. Download and activate the If-So Dynamic Content WordPress plugin and the Conditional Elementor elements integration.
  2. In the Elementor editor, select the element you want to use as location-based content.
  3. In the element settings panel, go to the If-So tab.
  4. Choose the Geolocation condition, and select the location type (country, state, city, etc.), then pick the specific locations you want to target. Screenshot
  5. Click Update to save the page.
  6. Test your location-based content using a VPN to simulate different locations.
  1. Download and activate the If-So Dynamic Content WordPress plugin.
  2. In the Gutenberg editor, select the block you want to use as location-based content.
  3. In the block settings sidebar, open the If-So Conditions panel.
  4. Choose the Geolocation condition and select the location type (country, state, city, etc.), then choose the specific locations you want to target. Screenshot
  5. Update or publish the page to save your changes.
  6. Test your location-based content using a VPN to simulate different locations.

Monthly Session Limit

Geolocation usage is limited by the number of monthly sessions (it’s the only If-So condition that is limited). The beginning of a session is defined as when a visitor first visits a page with a geolocation trigger. The end of a session is when either a visitor closes the browser, or there have been more than 25 minutes of inactivity (it may vary slightly between browsers).

Click here for the geolocation pricing options.

Troubleshooting the Geolocation Condition

If you set up a geolocation trigger and it seems to not be working properly, there are a few common reasons to consider. Click here for the geolocation troubleshooting guide.

Screenshots

add a new trigger 1
Create a trigger
Select location(s)
Content field 1
Set the geotargeted content
Default content 2
Set the fallback content
trigger shortcode
Apply the shortcode to your page
Elementor target locations
Geotargeted Elementor Element
gutenberg target locations 2
Geotargeted Gutenberg Block

Why If-So for geolocation based content?

  • No coding, no setup
  • Country, state, and city precision
  • Cache-safe
  • Works with any page builder
  • Always a fallback version
  • Get started for free — see it working on your site

Didn’t find what you need?

Autumn Sale!
Up to 40% Off. 30-day Money back guarantee.