Slow Redirect Plugin Or How To Make Affiliate Links Faster (Tutorial)

Share the knowledge...Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Slow Redirect Plugin Or How To Make Affiliate Links Faster (Tutorial)

In this tutorial I’ll show you how to make your affiliate links work much faster. It’s extremely useful if you use a redirect plugin or an affiliate link management plugin which started to work very slowly for you (this was exactly my case).


 

Intro

One day I found out that my affiliate links started working very slowly. Visitors clicked my affiliate links, and it took tens of seconds before the destination pages opened. It meant that I could be losing my income, not to mention irritating my readers. Degrading my website usability was obvious.

Long story short, it was due to a slowness of redirect plugin that I used. But before I got to know about it, all I knew was that for some reason the redirects initiated by my affiliate links management plugin worked awfully slowly.

The slowness of my affiliate links was a huge and unexpected disappointment for me. I worked hard to created useful content about hosting, website security, website backups and other stuff which contain affiliate links (this is the way I earn with my website). And loosing my income because of this technical glitch was annoying.

slow redirect plugin - slow redirect of my affiliate links

It took more than 10 seconds for the redirecting to work

And what you see above was not the slowest metrics 🙂 Any affiliate link on my websites worked beyond all bearing slowly.

I had to fix it.

And I made my affiliate links work as fast as possible in a secure way, staying under Google radar and not losing SEO link juice and keeping them clean and nice-looking.

slow redirect plugin - faster redirect of my affiliate links

After I fixed it the redirecting works quickly

And in this article I will help you to radically improve the time it takes for your affiliate links to work if you use any redirect management plugin or affiliate links management plugin.

By the way, I test website speed manually with a free tool webpagetest.org. The screenshot above is from that tool. I also reviewed other free website speed testing tools here, if you are interested.

 

The secret of making your affiliate links work fast

The secret is quite simple: get rid of the plugin that manages your redirecting to affiliate websites. Because it’s very likely (the proof of the concept is below) that the cause of the slowness of affiliate links redirecting is the plugin. And just use as simple method of redirecting as possible without using plugins which are the parts of the slower WordPress infrastructure.

But at the same time preserve your SEO link juice, keep your affiliate links nice and clean, secure and unnoticed by Google (which can penalize you if you don’t cloak your affiliate links properly). You will know how to do it in this tutorial.

Yes, you also get rid of many sweets that your affiliate links management plugin has such as stats, charts, affiliate links management from your WordPress dashboard etc. But in return you get speed of your affiliate links which do not depend on your WordPress. And it matters a lot for your visitor who is a potential buyer of the products that you promote as an affiliate.

Also, you will need to manage your affiliate links in a plain text file stored on your server. (You will need access to your files on your hosting, e.g. using cPanel or FTP). It’s very easy as you’ll see it below.

Basically, I took this method from Joost de Valk who also suffered from very slow affiliate links. Joost introduced this method in his blog post, which has all the information you actually need if you are tech-savvy enough. However, I found out that the instructions there are not comfortable for many unexperienced users. And that’s why I decided to make this easy tutorial.

By the way, if you want to speed up your website, check out this research on how some caching options can help you.

 

Prove the concept before you get rid of your affiliate links management plugin

Before you say good-bye to your favorite affiliate links management plugin or redirect management plugin, it’s a good idea to test how fast your bare simple redirects from your website work. This kind of redirect (302 Redirect) will not request database or run any script. You can add the redirect rule to your .htaccess file to check out its speed (I’ll show you below how to do it).

In other words, if 302 redirect to your affiliate link works much faster, then the bottleneck of your current speed issue is the plugin. And the method explained in this tutorial will help you greatly.

And if a bare 302 redirect works as slow as when using your plugin, then the problem is in your hosting, your affiliate marketing network or your destination (affiliate) website itself.

By the way, if you want a faster hosting, have a look at this research.

 
Here’s the practical part of how to test if it is worth to replace your affiliate links management plugin with the 302 redirect method described in this article. Also see a video tutorial below.

  1. Make a backup copy of your .htaccess file (it’s located in your public_html folder in your hosting account). It’s a good idea to have a backup copy of your .htaccess file (or the whole backup of your hosting account) in case something goes wrong.

    making affiliate links faster  - make a copy of your htaccess
    If you can’t find your .htaccess file, make sure that hidden files are displayed.

    By the way, if you want a reliable backup solution for your website or whole hosting account, have a look at this in-depth comparison.
  2.  

  3. Add the following code at the very beginning to your .htaccess file:
    Redirect 302 /tmpredir http://your_affiliate_link
    

    And replace http://your_affiliate_link with your real affiliate link.

    The URL slug “tmpredir” is just any unique word that is not used as a URL slug on your website (in other words, http://yourwebsite.com/tmpredir should not exist before).

    So, for example, my 302 redirect rule for WPEngine hosting affiliate program looks like this:

    Redirect 302 /tmpredir http://wpeng.in/researchasahobby/ 
    

    Here’s how my .htaccess file looks like after adding this code:

    slow redirect plugin - adding test redirect to htaccess to test speed

  4. Now your redirect test is ready. Test its speed. Open a new browser window and enter http://www.yourwebsite.com/tmpredir (replace http://www.yourwebsite.com with your website URL). In my case it will be https://researchasahobby.com/tmpredir.
     
    Then your affiliate product web page should appear. Notice how much time it took for your browser to open your redirect link. For more objective results (in order to avoid your browser caching etc) I suggest using a free service webpagetest.org that tests the speed of the link to open.
  5.  

  6. Compare the time with the time it takes for your previous affiliate link (generated by your affiliate links management plugin) to load. If the new redirect link works much faster, then you have proved the concept. And you can surely use the method described in the tutorial below to make your affiliate links faster.
  7.  

  8. Remove the redirect code from your .htaccess file that you created on Step 2. Or restore the backed up copy of .htaccess. You don’t need the test redirect code any more.

So, if you have proved that bare simple 302 redirect works faster than using your slow affiliate links management plugin (or your redirect management plugin), then see below the main part of the tutorial – how to get rid of the plugin and replace it with speed-efficient and secure redirects.

By the way, if you want to make your website more secure, have a look at this thorough article.

 

Setting up secure and fast redirecting for your affiliate links – Tutorial

Here’s a video tutorial that includes also the steps described in the above chapter (Proving the concept before you get rid of your affiliate links management plugin)

And here’s a text version of the tutorial:

  1. Create folder in your public_html (e.g. “/go/“). So, your new affiliate links on your website will look like http://yourwebsite.com/go/product/

    slow redirect plugin - Add folder for redirect

    Add folder ‘go’ (or you can name it whatever you want)

  2. Block this new folder for web crawlers in your robots.txt (located in your public_html folder) by adding
    User-Agent: *
    Disallow: /go/
    

    slow redirect plugin - add dissallow in robots_txt

    This will help to add extra layer to hide your affiliate links from search engines and other crawlers.

    If you don’t have robots.txt file, create it.

  3. Add to your new folder (e.g. /go/) a special .php script to handle redirects safely for your SEO rankings. Also add .htaccess file for your new folder (/go/). And add a sample text file (redirects.txt) with a list of the redirects that you can easily manage. You can download all these files here. You can also see the code of the files on gitgub here.

    If you can’t upload the sample .htaccess file to your server, make the unhidden (i.e. rename it to remove the dot at the beginning. For example, rename it to htaccess.txt and then you will be able to upload it. But then rename it back to .htaccess on your server.

    slow redirect plugin - uploading files to folder

    The files uploaded to ‘go’ folder

    By the way, .htaccess file works on Appache server (if you are not sure what it is, don’t worry, it’s very likely that it is your case, since most shared hosting use Apache or can support .htaccess files).
    Anyway, here’s the gist file for NGNIX server in case you need it.

  4. Edit the redirects.txt file:
    • Remove from it everything but the first line (i.e. leave default,http://example.com). And replace http://example.com with your website URL (forexample, in my case this this line looks like this: “default,https://researchasahobby.com“). This line handles incorrect redirects to avoid 404 Error (Page Not Found).
    • Add a test redirect line to see if it works. For example, add line “tmpredir2,http://google.com“:
       
      slow redirect plugin - test affiliate link redirect
       
      Thus, if you now enter http://yourwebsite.com/go/tmpredir2 in a browser, it should redirect you to google.com website.
      Note that the URL slug “tmpredir2” should be a unique word that is not used as your URL slug on your website (in other words, http://yourwebsite.com/go/tmpredir2 should not exist before)
    • If the test redirect to google.com works, then everything is fine. Then you can remove this test tmpredir2 line from redirects.txt and add there other lines with URL slugs and your afiliate URLs.

    Your final redirects.txt file may look like this:
     
    redirects.txt file sample for redirecting to affiliate links

And finally, just add additional level of protection of your SEO link juice, use rel=”nofollow” tag when putting your links to your website (blog post, page etc). For example, html code of my affiliate link for one of the hosting I recommend look like this:
<a href="https://researchasahobby.com/go/wpengine" target="_blank" rel="nofollow">Link to WP Engine</a>

By the way, I recommend a number of hosts depending on your unique needs and requirements on this page.

 
That’s it! Now your redirects will be handled quickly without using WordPress and your slow affiliate links management plugin.

Conclusion

This redirect method will definitely make your redirects faster because it does not use WordPress or its plugins. The speed is very important particularly for your affiliate links. No one wants to wait many seconds for your affiliate product’s page to open.

This is very useful if you use redirects management plugin or affiliate links management plugin which sometimes start working very slowly. In this case this method can improve the speed of your affiliate links by many times.

And this method provides a secure (protected from Google’s eyes) redirecting to your affiliate links. In other words, it cloaks your affiliate links safely.

Subscribe to my Free Researches
Work on your blog and small business more efficiently!

subscribe
BTW, I respect your privacy, and of course I don't send spam, affiliate offers or trade your emails. What I send is information that I consider useful.

Share the knowledge...Share on Facebook
Facebook
Tweet about this on Twitter
Twitter
Share on LinkedIn
Linkedin

Comments

  1. Hi Michael, I am using ThirstyAffiliate plugin on my WordPress and facing the same problem (over 0.5s for my server to redirect). Worse still, I notice the affiliate link from the affilate platform (CJ) creates more redirects before reaching the final URL. Anyway, certainly will give your method a try to speed up the first step. Cheers,

    • Charles, I don’t use any affiliate plugins and I’m pretty happy. I don’t get any perks like click statistics on my site etc, but I realized that I don’t really need it. Speed is more important to me.

  2. Hi,
    Could you specify what tools you use to test the affiliate links speed? You put a screenshot at the beginning of the article with the speed marks.

    Good piece of content indeed.
    Thanks

  3. Hi,

    Thanks so much for the detailed piece. I’m following this and using “recommends” instead of “go” so that it will be easy for me. since i use thirsty affiliate plugin default “recommneds” option.

    So I want to know if I will also need to change things up all afresh or use it that way after configuring it from my FTP?

    • Hey Khris,
      This methods is not supposed to work with an affiliate plugin if you use the same folder name (“recommends” in your case). If you want to use this method, then I suggest getting rid of the plugin and change up all the thing afresh, yes. Alternatively, use another folder name.

  4. Ludovic François says

    Thanks a lot for this !!

    • Yeah, this saved me as well one day when redirect plugins and affiliate links plugins started taking very long to work.

      • Ludovic François says

        Yes this work for now!!! Thanks again 😉

        But i’m in France and i ask a question to the Amazon Affiliate support about this 301 redirection. Possible or not ? And it say me to search in the agreement page !!! 99999 lines !!! I don’t have an answer to my question !!! lol

        • Sorry, I did not understand your question. What’s possible or not? The redirecting method I described in this tutorial works for any affiliate program. It can be Amazon or whatever else and in any country.

  5. Hi Michael,

    Actually I was also fall in this situation my website was going down day by day because my affiliate links started working very slowly. But when I follow your trick I got my solution at the peek time.. Thank you so much sharing your great experience. Please share more with us

  6. Hi Michael,

    Thanks for this explanation. I actually found the Yoast article before yours, and tested it on my website, but ended up on your website because my redirects are still slow with this script (4 seconds at least).
    But your way of testing 302 before implementing the script is very interesting, because on this test it takes few milliseconds only to load…
    Example with 302 in htaccess : http://beastof.com/tmpredir
    And example with the Yoast script (redirects to the same website) : http://beastof.com/goo/testclo

    It’s totally slow compared to the previous one. Any idea why ? Thanks for your help 🙂

    • Hi Berenice,
      I’ve tested both your links and they seem both to be not slow: https: //www.webpagetest.org/result/170308_XK_AA4/ and https: //www.webpagetest.org/result/170308_GV_APE/.
      I’d assume that during your slow test there could be your hosting server’s temporary overloading or a network increased latency (surely not due to your redirects 🙂 ).

      • Yes, indeed, it seems fixed now oO
        Weird that I tested both links several times in a short time window so I don’t understand how one would be consistently much slower than the other. But anyway, thank you 🙂

        • Hi Berenice,
          A pure redirect uses Apache server functionality, whereas redirect with /goo/ uses php. So, at the time of testing there were probably some serious issues with handling php on your server.
          Anyway, glad to hear it’s all fixed now.

  7. Hi,
    Thanks for the great article.
    Why don’t do the redirects just via the .htaccess file?

    • Hi Daniel,
      Thanks for your question.
      Bare redirect via htaccess file don’t hide your affiliate links, which is not good for SEO (Google does not love a lot affiliate links on your page). And the way described in this article uses a Yoast’s simple script that adds “X-Robots-Tag: noindex, nofollow” to the header of the redirects. This is a safer approach of dealing with affiliate links.

It's important for me to know what you think

*