How to create geo redirects with WordPress (using a plugin)

by Last Updated: Jan 21, 2024Blog, WordPress Tips

UPDATE: I have released my own URL shortener tool, which I introduced in this article. It is also a great alternative to Pretty Links and similar services like, for example.

If you are an affiliate marketer and you are looking for a way to geo-localize your affiliate links on WordPress, I have a clever solution for you. Just continue reading this article. I will explain to you how to achieve it.

So, my advice is to use the Pretty Links WordPress plugin. Maybe you are already using it. I use it to create nice affiliate redirects on this blog, for example this one: – this way I create nice URL links for my affiliate links. It is also called link masking.

I have been using the free plugin Pretty Links on my affiliate blogs for a few years already. Recently, I needed to direct the US visitors to a different affiliate link than the visitors from the rest of the world on one of my blogs. This has been caused by some strict US laws, which required my affiliate advertiser to use a different landing page for the US visitors.

Because of this, I started looking for a solution to this problem. Since I already had been using the free version of the Pretty Links plugin, I checked their premium plans and found out that they offered a geographic redirects feature. I decided to try it out, so I purchased a Beginner license. And I was amazed because I didn’t have to install anything new to my WordPress website. The only thing that I needed to do was to insert my license key into my WordPress installation. After that, it worked immediately and I was able to geolocalize my affiliate links. You can see how it is set up on the screenshot below. I added a different URL redirect for the US traffic.


WordPress Geographic Redirects


It’s really easy to use and works like a charm. At first, I thought I would have to install an additional plugin for this (e.g. Geolocation IP Detection), but this was not the case. Pretty Links already has it all integrated, so I could keep my WordPress install as lightweight as possible.

Note: Please be aware that some affiliate programs do not allow you to use custom redirects for your affiliate links. For example, the Amazon affiliate program. They, however, have their own geo targeting system (for Amazon it’s called One Link). Alternatively, you might like to use another premium WordPress plugin for this. You might like to check out GeniusLink.

Note #2: In general, WordPress redirect plugins generally leverage IP address, which is not very accurate, especially for mobile. I would recommend GPS based geo redirect for an optimal outcome, says Owais Shah from InsiderApps.

I hope I was able to help you with this article. If you need any help with setting up your affiliate links correctly, feel free to contact me.

5 Free WordPress Plugins You Should Use

Banner - Author Box for Divi Plugin


Author: Andrej

WordPress expert. Divi user since 2014. I blog about WordPress and Divi, my favorite WordPress theme. When I’m not working with WordPress or writing an article for this blog, I’m probably learning Italian. You can read more about me here.