Amazon, the world’s largest online retailer, offers one of the best affiliate programs, which any website should leverage. Several WordPress plugins simplify the process of adding Amazon affiliate links: AAWP, AzonPress, Pretty Links, ThirstyAffiliates, and Auto Amazon Links.
This is a guide to easily add auto tag tracking Amazon links in WordPress without plugins.
The code below should be entered into the functions.php file of the theme you are using (or child theme).
This code adds rel=”nofollow” and target=”_blank” attributes to external links and adds a tracking ID (?tag=thuy-20) to Amazon.com links. It also skips adding these attributes to internal links.
You change thuy-20 to your tracking ID tag.
If you have any questions, please leave a comment below.
Next article: Common Reasons why Your Amazon Associates Account has been closed.