page loader

WordPress Geo Targeting & IP Geolocation

In this article, we will explain a number of methods to geo target your WordPress website using Geolify and our WordPress plugins. We will also discuss the benefits and uses of each method as we go.

  1. What is geo targeting?
  2. The WordPress platform
  3. How does Geolify work?
  4. Redirecting your WordPress blog by IP geolocation
  5. Displaying geo targeted content & images in WordPress
  6. Displaying geo targeted popups & notification bars WordPress
  7. Blocking your WordPress site by IP geolocation
  8. Displaying visitor location in your WordPress blog

 Plugin download links

  1. Geo Redirect
  2. Geo Content
  3. Geo Image
  4. Geo Popup
  5. Geo Bar
  6. Geo Block
  7. Geolify Plugin (for Geo JavaScript service)

 

What is Geo Targeting and IP geolocation?

Geo targeting is the process of targeting visitor’s based on their IP geolocation. Targeted visitor’s are usually displayed particular content that is relevant to the visitor’s IP geolocation thus making the visitor feel more engaged. IP geolocation is another term for the visitor’s coordinates (latitude and longitude) on the Earth’s surface. By obtaining the IP geolocation of a visitor, you can retrieve the visitor’s country, state and city.

 

The WordPress platform

WordPress is an extremely powerful website builder used by millions of people and businesses to create simple blogs all the way to complex community based websites. With WordPress comes a multitude of user developed plugins built over the years. Wordpress out of the box does not contain any geo targeting or IP geolocation features. However a number of free geo targeting plugins exists that allow WordPress developers to geo targeted content as well as display the location of a visitor.

Free plugins are great, however there are a number of issues experienced free WordPress geo targeting plugins. They are:

Local IP location database required
Requirement to download and install a particular IP to location database to your server. The installation process is often complex and requires skill. Some databases also require you to pay and most of the free database require you to leave a back link to their service.

Unreliable APIs
If there is no requirement to install an IP to location database, the plugin will request IP geolocation information from a stored database on the plugin’s server which being free is probably not maintained and monitored which in turn will drastically slow down your WordPress website especially if you have many visitors.

Inaccurate
Free IP to location databases usually have inaccurate IP geolocation information which can be detrimental to your visitors if it detects their location incorrectly.

 

How does Geolify work?

Geolify is a dedicated SaaS platform for geo targeting websites. Out of the box, Geolify can perform a number of geo targeting functions including URL redirection based on location, displaying content, images, popups and notification bars based on location. Geolify is designed on a Javascript platform which means it has the capability to work with any type of platform and in this case WordPress.

Steps to use Geolify with WordPress

  1. Sign up for an account with Geolify
  2. Choose a service (Geo Redirects,Geo Content, Geo Images, Geo Popups, Geo Notification Bar, Geo Block)
  3. Setup the service in Geolify
  4. Download the relevant WordPress plugin
  5. Enter the ID of the service into the WordPress plugin setup

 

Advantages of using Geolify to geo target your WordPress website

  1. Powerful location segment (target by including/excluding countries, states, cities, lat/lng/radius and IP address)
  2. No requirement to modify or write any php code
  3. WordPress plugins available for easy Geolify script addition
  4. Visual dashboard in Geolify for easy setup and editing
  5. Ability to handle a high request rate for geo data
  6. One account can be used in multiple websites (perfect for marketers and web designers)

Geolify’s geo redirect setup example

Wordpress Geo Redirect

WordPress redirection by IP geolocation

Geolify Geo Redirect WordPress Plugin

One of Geolify’s most used services is geo redirection. In other words, redirecting your website visitors to another page or website by their country, state, city, latitude/longitude/radius or IP address. Geo redirection is a an excellent method for sending visitors from your WordPress website to another country specific website or a country specific page. For example you may have multiple WordPress websites for each country (example.com, example.ca, example.com.au, example.co.uk). Using Geolify and Geolify’s Geo Redirect plugin, you can easily perform both simple and complex redirection.

Features of Geolify’s Geo Redirect service and WordPress plugin

  1. Redirect entire website or only selected pages
  2. Redirect by including or excluding countries, states and cities
  3. Redirect by including or excluding boundaries defined by latitude, longitude and a radius
  4. Redirect by including or excluding IP addresses
  5. White list referral domains to prevent redirect for visitors coming from particular domains
  6. Redirect visitors who come from external sources only
  7. Pass query strings or sub directory paths onto the redirected url
  8. Unlimited location-redirect pairs

 

Displaying geo targeted content in WordPress

Geolify WordPress Geo Content Plugin

Geolify provides a Geo Content service that can allow you to create ‘dynamic’ content that can change based on visitor IP geolocation i.e. country, state and city. Using this service you can easily opt to show or hide specific content which can include rich text, images, videos or any HTML based on the visitor’s location. A perfect example of geo targeted content is displaying phone numbers based on a visitor’s location. Often a single WordPress website is used to cater to a global audience however you may have offices in different countries. Instead of showing all phone numbers at once on your landing page which is tight in real estate, you can only show the phone number that is most relevant to the visitor’s location.

Features of Geolify’s Geo Content service and WordPress plugin

  1. Create content using a WYSIWYG editor that supports HTML (rich text, images, videos or any html code)
  2. Display content by including or excluding countries, states and cities
  3. Unlimited location-content pairs
  4. Place shortcode in your WordPress page or post where the Geo Content should appear

 

Displaying geo targeted images in WordPress

Geolify WordPress Geo Images Plugin

Sometimes it may be nesessary to quickly create a dynamic image that can change based on visitor location. A great example is if you are running promotion banners on your website and you would like to show different promotions to people in different states or cities. This is where Geolify’s Geo Image service can be used in a WordPress website to easily change images based on country, state and city. Setting up Geo Images are easy with Geolify. You just need to specify an image url for a particular location segement. There is no limit to how many images you can specify. A simple shortcode is then used in your page or post to display the Geo Image.

Features of Geolify’s Geo Image service and WordPress plugin

  1. Use your own hosted images by specifiying the image url
  2. Display images by including or excluding countries, states and cities
  3. Unlimited location-image pairs
  4. Place shortcode in your WordPress page or post where the Geo Image should appear

 

Showing popups based on visitor IP geolocation

Wordpress Geolify Geo Popup Plugin

Popups are a great way of attracting attention of visitors and are widely used in almost every website around. Popups can be used for lead capture or for showing promotions, the uses cases are endless. However the conversion rate of the popup is highly dependent on how relevant the popup information is to the visitor. An excellent method for ensuring relevancy is to display information in the popup that is applicable to the visitors IP geolocation. Geolify’s Geo Popup service can easily allow you to display various popups to visitors from certain countries, states and cities. For example you may want to offer a free shipping code to only customers in your city. Displaying a geo targeted popup only to these visitors is a great way to avoid annoying those outside your city who cannot use the free shipping code.

Features of Geolify’s Geo Popup service and WordPress plugin

  1. Create popups using a WYSIWYG editor that supports HTML (rich text, images, videos or any html code)
  2. Change popup dimensions, background color and background image
  3. Display popups by including or excluding countries, states and cities
  4. Unlimited location-popup pairs

 

Showing notification bars based on IP geolocation

Geolify WordPress Geo Bar Plugin

Geolify’s Geo Bar service allows you to display a sleek notification bar on the top of your WordPress website based on visitor IP geolocation. The bar can be styles to suit your color preferences and also include a button link. Geo Bars are a great way to attract attention or lead capture without being ‘in your face’. Geo notification bars are useful for display location specific alerts to visitors. For example you may want to display the EU cookie law to only EU visitors. The Geo Bar can be used to display a notification bar only to visitors in countries from the EU region.

Features of Geolify’s Geo Bar service and WordPress plugin

  1. Block by country, state, city or IP address
  2. Unlimited location-block pairs

 

Blocking your wordpress website by IP geolocation

Block visitors to your WordPress website using Geolify's Geo Block plugin

Sometimes it may be necessary to quickly block visitors from certain countries from visiting your website. This is known as geo targeted block and can be easily achieved using Geolifys Geo Block service. This service works by redirecting unwanted visitors away from your website by their IP geolocation. This is great for chasing away spammers or people from certain countries who continually spam your contact forms.

Features of Geolify’s Geo Bar service and WordPress plugin

  1. Change notification bar text and include an optional button link
  2. Change background color, text color and  button color
  3. Float or let the notificaiton bar scroll
  4. Allow the bar to be closed using a close symbol
  5. Unlimited location-notification bar pairs

 

Getting visitor IP geolocation data in WordPress

Geolify WordPress Plugin

Sometimes it may be necessary to obtain visitor country, state or city direct in your WordPress HTML to carry out specific tasks. For example lets say you have a country select box which you need automatic country selection or lets say you need to display the visitor’s city in a banner. This can easily be done using Geolify’s Geo Javascript service which lets you obtain visitor IP geolocation data using simple Javascript functions. You can then write more Javascript code to carry out particular functions with the location data. To make IP geolocation data available by Javascript, you will need to paste Geolify’s code into your WordPress HTML HEAD which can usually be accessed by your theme setup. Another great example is displaying a visitor’s IP geolocation automatically on a map. You can get visitor latitude and longitude using Geolify’s javascript functions and pass it onto a Google map.

Features of Geolify’s Geo Javascript service and WordPress plugin

  1. Get visitor country, state and city
  2. Get visitor latitude and longitude
  3. Display information in a post or page using short codes
GEOLIFY

#1 Geo Targeting SaaS

Geo Redirects

Geo Content

Geo Popups

Geo Images

Geo Notifications

Geo Links

Geo Javascript

Get Started For Free