I have written an article earlier on how to generally cloak and organize affiliate links in WordPress. But in this article I will show you how to setup your WordPress system so that you can easily create and cloak Amazon affiliate links on the fly.
The end results will be something like this. To link to an Amazon product, you would simply put
http://yourdomainname.com/amazon/[ASIN]
And this unique link of yours would forward to Amazon’s product and credit you for any sales. As you should’ve guessed, to link to a different product in Amazon’s catalog, you just change the ASIN number in the link above.
This should make it very convenient for you not only to link to Amazon, but also cloak your links effectively.
So, let me show you how to set this up…
First, you need to install the plugin Redirection. Through this plugin, you can setup automatic URL redirects.
Now, in your WordPress admin area, go to “Tools” and then “Redirection”.
You’ll see a section with the heading Add new redirection. Enter the following values in the form below it:
- In Source URL, enter /amazon/([^/]*)
- In Target URL, enter http://www.amazon.com/dp/$1/[Your Amazon Associate ID]
- Make sure that you check the box that says Regular Expression
- Click save, and you’re done!
Now, your blog will automatically direct visitors to Amazon products. All you have to do is supply the ASIN number like in the example above.
If you want more details or if you want to know how to do the same for your ClickBank links, check out my earlier article.
If you have any questions or if anything isn’t clear, feel free to ask in the comments.
I may create a WordPress plugin to make this even easier. Stay tuned for that.
thank you for your plugin. this is just what i need. but i have a question regarding your amazon syntax. you mentioned:
http://yourdomainname.com/amazon/ASIN
do we have to put ASIN inside [ ]
also in target url:
http://www.amazon.com/dp/$1/Your Amazon Associate ID]
do we have to put the Amazon Associated ID inside [ ]
Oh, I see how that’s confusing. Thanks for bringing my attention to it.
For `http://yourdomainname.com/amazon/[ASIN]` and `http://www.amazon.com/dp/$1/[Your Amazon Associate ID]`, the brackets are to be removed.
However, these brackets `/amazon/([^/]*)` should be kept!
This is the perfect solution for me!
I’ve been looking for a plug-in and instructions just like this – thank you : ).
Ok, actually I’m confused.
I believe I set everything up according to your directions.
The link works but my affiliate id is being displayed at the end of the url.
Am I missing something?
Thank You!
Jon, Yes, your Amazon affiliate ID will be displayed at the end of the URL. In fact, Amazon utilizes a few different formats for their affiliate links, and all of them show the ID of the affiliate. So, there’s no way around that.
Hi MK,
In a resent comment you mentioned that the affiliate ID is still displayed in the URL.
Is this the URL customers will see, or the one http://yourdomainname.com/amazon/ASIN
Just trying to better understand how an Amazon affiliate protects his ID from being hijacked or stripped off?
Thanks. Ken
I keep getting my URL showing up in front of the target URL. Not sure what is wrong.
How so? Can you give an example?
My source is ‘/amazon/([^/]*)’
My redirect is ‘http://www.amazon.com/dp/$1/My Amazon Associate ID]’
My link is ‘http://sandboxes.caroline.motsa.net/sandbox3/amazon/My Amazon Associate ID]’
I am getting this :
http://sandboxes.caroline.motsa.net/sandbox3http://www.amazon.com/dp/0312205171/My Amazon Associate ID]
Obviously, you have to replace [My Amazon Associate ID], with the real Associate ID…So, I assume you did that.
Your “source” and “redirect” are correct.
Now, if your website is http://sandboxes.caroline.motsa.net, you’d do http://sandboxes.caroline.motsa.net/amazon/B004MPRFAC/. And that should work.