The problem with affiliate links
Over time, the number of the links on a site increases to an amount that could be hardly managed manually. The trouble begins with even small-scale projects when the replacement of the old links with new ones is required — for example, in the case of redirecting traffic from old links to new pages. Manual replacement is the backbreaking labor. In addition to difficulties maintaining the links, a large number of external links can influence the search engines’ treatment of your project. Converting links to inline tag <nofollow> partially solves the problem with search engines but doesn’t simplify the maintenance of the hundreds of links on your site.Solution
The fundamental solution to the problem is to use a link management system to fix the links via a redirect. With tools for creating and managing links, you can replace a target URL in just a few clicks. In the end, the link in your article still has the same format yourdomain.com/link1, but the user goes not to Aviasales.com as before, but to flights.Aviasales.com, for example. There are several ways to manage affiliate links. We have collected the most important ones below and reviewed them in detail.What is the redirection of links?
Redirecting is referring users to another page. When clicking a link such as yourdomain.com/link1, the user lands on the affiliate page — for example, Aviasales.com. Redirection is necessary not only for managing links in articles but also for eliminating doubling, 404 errors, and domain name slake. In the last case, you can save the site’s position in SERP and traffic from the previous domain name. Redirect algorithms are very simple:- The user clicks a link.
- The server or browser processes the data.
- The user is automatically redirected to the defined link in cases where there is redirect.
Redirects 301, 302, 307
Ten HTTP codes for redirects exist, but only three of them are in demand. Let’s look at their key points.- 301: A constant redirect indicating that the transfer is permanent. This code usually means the site’s redirected while moving to another domain.
- 302: A temporary redirect. It indicates that the site move is temporary. This is perfect for the redirecting affiliate links.
- 307: A Temporary redirect. The implementation of the code doesn’t allow the query method (GET/POST) to change. In practice, codes 307 and 302 are identical.
How to set up a link redirection
Rookies could hardly deal with putting redirects into effect. That’s why we have reviewed the basic methods for redirecting links.Services for truncating links
These services help redirect links without changing your settings or installing software. You can just use the services’ web-based versions:- https://goo.gl/ (works up to March 30, 2019)
- https://u.to/
- https://bitly.com/
If you’re working with programs through Travelpayouts and your goal is to create beautiful, short affiliate links, it’s not necessary to use third-party services. You can create a short URL without leaving your Travelpayouts’ account. Simply open the «Link Generator» tool on the page of the selected program and fill in the required fields. The generator will return a short version of the affiliate link with the name of the brand included.
HTML, JS, and PHP Scripts
Redirection that is done with the aid of PHP scripts puts additional strain on the server. However, it is preferable when you have a great number of pages. This kind of redirection is performed on the server level. A redirect using JavaScript operates on the browser level. The full load in the browser is required to make it work, which is why this method is slower than a PHP redirect. It is sometimes used for redirections with a delay. Also, JS redirect doesn’t work unless you switch on a JavaScript function. Redirection via an HTML code is similar to JS and operates on the browser level, so it proceeds slower than redirects on the server level.WordPress plugins
If the website is based on WordPress, then it is better to use third-party plugins. They help to shorten the link and to create the link on your domain, as well as manage redirects and collect statistics. Below we look at each of the redirects’ methods and give the valid sample.The top three URL shorteners for shortening long links
- Goo.gl

- The number of hops
- Citations for the links on the web
- The map of popularity in different countries
- Platforms and browsers viewer use the most often
- Bitly.com

- Detailed analyses
- A link builder
- Flexible corporative settings
- Extensive technical support
- A personal manager
- U.to

Popular plugins for WordPress
Design plugins offer a similar mechanism but include various extra functions. You will get a shortened link on your domain as a result. Plugins provide fast link redirection on WordPress and a convenient way to manage the links. For example, you can replace the target URL.Thirsty Affiliates Affiliate Link Manager

- Easy to use due to the visual editor
- Increased experience with managing links
- Safe redirect via the 301, 302, and 307 codes
- Add images to the affiliate links
- Statistics and reports
Shortlinks by Pretty Links

- 301, 302, and 307 redirects
- Link categorization
- Statistics graphics
- Data exporting in .csv format
How to install
You can download the archive from the official library or install the plugin via your website’s administrative panel. Type the plugin’s name in the search bar and click Install:

Links creating
Hop to the “Add Link” section: https://yourdomain.com/wp-admin/admin.php?page=add-new-pretty-link. The editor will open. Set a short link and a target URL:
Managing links
All the links are accumulated on the plugin’s main page. Here you also see the basic statistics, such as the total number of clicks.

Expanded opportunities
Everything that is outlined above is available in the free version. The plugin’s paid version, Pretty Link Pro, is also available. The following functions are available with the paid version:- Auto-replacement of links on the website
- Auto-deployment of links for the specified words
- Redirect based on the user’s country
- A/B testing
- Other functions
Easy Affiliate Links

The plugin’s key points are
- An intuitive interface
- Statistics
- Link categorization
- Link importing and exporting to .XML
Shortlinks for Jetpack Sharing Buttons

Link redirection via PHP-script and JavaScript
As we have indicated, PHP redirects work faster than JS, making them more popular among webmasters. To realize a simple redirection, add the following code to the index.php file:$links = parse_ini_file('shortlinks.ini'); if(isset($_GET['l']) && array_key_exists($_GET['l'], $links)){ header('Location: ' . $links[$_GET['l']]); } else{ header('HTTP/1.0 404 Not Found'); echo 'Unknown link.'; }
Aviasales = https://www.Aviasales.com/?marker=XXXXXX.short
<script> window.location.href = "https://www.Aviasales.com/?marker=XXXXXX.short"; </script>
The best solution for the WordPress sites
It is only half of the story to create the link with a redirect. Then you’ll have to manage the link – track statistics and change target URLs. The turnkey solutions look better than common PHP/JS scripts as they allow you to do more with less effort. Except the link managing that you’ve already had, you can have one more problem – implementing new links on the site or replacing the old ones. For example, you have been doing the travel blog for 4 years already but have just found out the special plugins for links. Then you have to solve the problem – replacing hundreds or even thousands of old links. Plugin Pretty Link in the enhanced version is a versatile solution. In addition to redirection, it has extra auto-options:- Replace the old links for the links in a new format.
- Set the links for the words that haven’t had them before.
How to make the total replacement of the old links on the website?
Important! You should always create a backup copy of your site’s database before starting the replacement! The Plugin BetterSearchReplace will be helpful for the auto-replacement of the old links for the new ones, as well as with the positioning of references to the words. More than 50,000 active installations are currently being used. Its main options are as follows:- A massive replacement of the old links.
- Selecting the separate tables to work.
- An “idle” start to look through the areas that are going to be updated.
<a href="https://www.Aviasales.com/?marker=XXXXXX.short">flight ticket</a>