How to add Amazon Affiliate Advert Code to WordPress Blog

Last updated on August 13th, 2014 by Robert Abela. Filed under WordPress Security Tutorials & Tips

One way to monetize your blog is to place adverts on your blog posts. There are many affiliate programs available on the internet to choose from. One of the most famous one is the Amazon affiliate program. The scope of this blog post is to explain how to add Amazon ad Code to your WordPress blog post.

First you should be subscribed to the Amazon Affiliate Program. To register with the Amazon Affiliate Program is really straight forward and it is out of the scope of this blog post.  Once you have an account, you can proceed to choose the product and embed it to your blog post.

Finding the product to advertise on your blog

Login to the Amazon Affiliate Program and search for a product by entering a search term or specifically the product name.  Else navigate to the ‘Links & Banners’ drop down menu and select ‘Product Link’ if you want to sell a product. Enter the search term of the product you are looking for. Once you find such a product, click on the ‘Get Link’ button and you are presented with the link below.

Amazon Affiliate get product link for advert

WP White Marketing Tip: Always tick the option ‘Open link in new window’ so users do not navigate away from your website.

Adding a Text Only Amazon Advert Code to your WordPress blog

If you opt to add a Text Only Amazon add, all you need to do is to copy the link and paste it in the HTML editor of WordPress as seen below.

text only amazon advert on WordPress HTML editor

Adding a Text and Image or Image only Amazon Ad Code to your WordPress blog

After choosing the right advert options that fit your blog post, such as image size, link colours etc, it is time to place your advert on your blog post. Similar to the Text Only Amazon Ad Code, you have to switch to the HTML editor in WordPress to place the code. You can use the code below in the HTML editor to place the code.

<table border=”0″ cellspacing=”10″ align=”left”>

Using the HTML code above gives you the flexibility to be able to set the justification for your Amazon advert in the WordPress blog post and also to add space around the advert as explained in detail further below. Using the above code, the advert will appear in the blog post as shown in the below screen shot.

image and text amazon affiliate advert look

Placement of the advert in the blog post

The HTML attribute code aligh=”left” (highlighted in the below sample HTML snippet) is used to left justify the advert in the blog post. Change the value to right to have the advert right justified and  center to have the advert with centred justification.

<table border=”0″ cellspacing=”10″ align=”left”>

Adding spacing round the Image and Text Amazon advert

You can also increase the value in the cellspacing to increase the spacing between the advert and the text around it. To do so, increase the value of the cellspacing HTML attribute (highlighted below).

<table border=”0″ cellspacing=”10″ align=”left”>

WP White Marketing tip: Do not flood your website with adverts and make it clear which is advertising content and which is the website content. Website visitors do not like to be fooled, and no one likes websites flooded with adverts.

WordPress Hosting, Firewall and Backup

This Website is:


Judy 26/11/2012

Dear WordPress,

In my WP blog I switched to HTML and then as directed above I used your code for adding a text and image, then pasted my affiliate code from Amazon in my WordPress blog, but it didn’t work. Why? This is what I did:

Can you please help? Many thanks!

John Bonello 03/12/2012

@Judy it depends what rights your user has. If you are not an admin or editor WordPress automatically removes iframe tags. In that case you can use such plugin

Susanne Lumsden 08/03/2013

Hi – just to check whether this tutorial applies to as well as – I have not been having much luck with my blog –

Robert Abela 08/03/2013

Hi Susanne,

Yes it should also apply to Give it a shot and let us know 🙂 Good luck.

Laura 20/03/2013

Hi There,

I was so happy to find this post, but this didn’t work for me. I’m trying to use the text and image from Amazon, but all that showed up in my post was two gray lines….Any tips for how to fix it? It sounds like I have the same issue as Judy above. I own my blog, so I should have full right I would assume.

Thank you,


Robert Abela 20/03/2013

Hi Laura,

Thank you for your comments. Even though you own the blog, it does not necessarily mean you are using a user with administrative rights. If you host your own WordPress rather than having a blog with check that you can see the plugins and the WordPress settings page to confirm that you are the blog administrator.

Let’s start from there. If you are and it is still not working, the best solution is to contact us and we will assist you. It is quite difficult to find out what is wrong unless we get our hands dirty.

All the best with finding a solution.

Domini Hedderman 11/07/2013


Thanks for the post. I couldn’t get it to work, either. I add the code from Amazon Associates sandwiched in between

This works for the image only but NOT when I try to add the image with text.

Any ideas?


Robert Abela 17/07/2013

Hi Domini,

It should work. Drop us an email on and we will help you sort it out.

Looking forward to hearing from you.

Amanda 27/04/2016

I know this post is 3 years old but this really fixed my problem of my text and image links not showing up! Thanks so much!

Leave a Reply

Your email address will not be published. Required fields are marked *