Restrict for Elementor

Show or Hide Elementor Content by Visitor Country or Continent

It is not uncommon to serve different content to visitors from different countries and continents — regional offers, legal notices or language-specific messages. With Elementor geolocation content restriction in Restrict for Elementor, you can show or hide any Elementor section, column or widget based on the visitor’s country or continent. This guide walks you through the full setup, from installing the required geolocation plugin to applying the visitor location criteria on your page.

How geolocation detection works

Restrict for Elementor integrates with the free Geolocation IP Detection plugin and hooks into its ability to detect the country or continent of the visitor. Restrict for Elementor doesn’t do the IP lookup itself — it uses the location that Geolocation IP Detection provides, and then shows or hides your content based on the criteria you set.

That means the first step, before the Visitor location criteria will do anything useful, is installing and configuring Geolocation IP Detection.

Step 1: Install the Geolocation IP Detection plugin

Install and activate the Geolocation IP Detection plugin from the WordPress.org repository, just like any other plugin.

Once installed, it is advisable to configure it to use a different data source than the one it comes preconfigured with. For example, you can use the MaxMind City or Country database, which will give you much more precise results regarding your visitors’ location.

Step 2: Set up the MaxMind database

  1. Register for a free MaxMind account.
  2. Once you have created the account, download the database file from the Download Files area by clicking the URL highlighted in the screenshot below.

MaxMind Download Files page showing the GeoIP database download link

  1. Upload the downloaded database file to your website.
  2. In the settings of the Geolocation IP Detection plugin, enter the path to that file along with the Account ID and License key credentials of your MaxMind account.

Geolocation IP Detection plugin settings with MaxMind database path, Account ID and License key fields

Granted, downloading and uploading the database manually is a bit of a hassle, but it is well worth it: the MaxMind database provides considerably more accurate location results than the default configuration.

Step 3: Show or hide Elementor content by visitor location

With the geolocation setup out of the way, you can now apply the criteria in Elementor:

  1. Create or edit a page using the Elementor page builder and add a section, column or widget.
  2. In the Content area of that element, select Visitor location as the criteria.
  3. Two new fields will be revealed. In the first dropdown, choose whether you want to use Country or Continent as the location type.
  4. In the second field, enter all the countries or continents you want to use as the criteria for showing or hiding this content.
  5. Save the page.

Visitor location criteria in Restrict for Elementor with country and continent options

One page, different content per country

Because the criteria is applied per element, you can set different rules for different sections, columns and widgets — even on the same page. That lets you use a single page to display different content to visitors from different countries or continents: a European visitor might see one offer while a visitor from North America sees another, all without maintaining separate pages.

Tips and troubleshooting

  • If the Visitor location criteria doesn’t behave as expected, first confirm that the Geolocation IP Detection plugin is active and properly configured — Restrict for Elementor relies entirely on it for the location data.
  • Keep in mind that IP-based geolocation is never 100% exact: visitors using a VPN or proxy may be detected in a different country than the one they are physically in.
  • Using the MaxMind database as described above gives you noticeably better accuracy than the preconfigured source, so it is worth the extra setup time.

Show alternative content to visitors from other locations

Instead of simply hiding an element, you can display alternative content to visitors from other countries or continents — for example, a generic international offer where a regional one doesn’t apply. More about this feature can be found in the displaying alternative content guide.

Related documentation