How to Add Affiliate Links to WordPress

Affiliate marketing is one of the more practical ways to earn from a WordPress site. You write about a product or service, link to it, and earn a commission when a reader clicks through and buys. Done well, it adds genuine value to content — readers find what they were going to search for anyway, and you earn something for the recommendation.

The mechanics are straightforward, but managing affiliate links directly as plain URLs creates problems over time. When a merchant updates their tracking parameters, changes their programme, or the URL breaks, you have to hunt down every instance manually. A purpose-built approach — using WordPress’s permalink structure with a dedicated plugin — makes links easier to manage, more consistent, and easier to audit.

This guide covers how to set up affiliate links in WordPress properly: from installing a link management plugin to inserting links into content and making sure your disclosure is in place. If you are still working through the initial build, the step-by-step guide to building a WordPress website covers everything you need before monetisation becomes relevant.

Install a Link Cloaker, Then Insert From the Editor

Install the ThirstyAffiliates plugin, go to Affiliate Links → Add New, paste your raw affiliate URL, give it a title, and save it. This creates a clean redirect-based link at a URL like yourdomain.com/recommends/product-name. Use that link in your content instead of the raw URL. If the destination changes later, update it in one place and it updates everywhere.

Raw affiliate URLs are long, contain tracking parameters, and often include your publisher ID — information that can be stripped by browsers or ad blockers before a reader reaches the merchant’s site. A managed redirect link solves this by routing the request through your own domain first, which protects the tracking.

There’s also a practical organisation argument. Most affiliate sites eventually accumulate dozens or hundreds of links across multiple programmes. When a merchant updates their tracking URL or discontinues a programme, you want to change one record rather than searching through hundreds of posts.

A disclosure page also becomes necessary as soon as you earn money through affiliate links — in most countries, sites must clearly tell readers when a recommendation is monetised. Before you start publishing affiliate content, the guide on essential pages every website should have covers what legal and disclosure pages are typically required.

ThirstyAffiliates vs Pretty Links — the Numbers Behind the Choice

This guide uses ThirstyAffiliates as the walkthrough plugin because its dedicated affiliate-link workflow (categories, a direct editor-insert button, per-link click stats) maps cleanly onto what an affiliate site actually needs. Checked live against the WordPress.org API today, though, it’s worth knowing ThirstyAffiliates sits at roughly 30,000 active installs, while Pretty Links — often described as just “the main alternative” — is actually considerably larger at around 200,000. Pretty Links leans more general-purpose (it’s built as a broader link shortener/redirect manager that affiliate sites happen to use well, rather than an affiliate-first tool), which is likely why it has the wider install base despite ThirstyAffiliates being the more affiliate-specific product. Either will serve most sites well; if you already shorten or redirect non-affiliate links too, Pretty Links’ broader scope may suit you better.

Setting Up ThirstyAffiliates

Step 1 — Install ThirstyAffiliates

From your WordPress dashboard, go to Plugins → Add New and search for “ThirstyAffiliates”. Install and activate it. The free version handles the core use case well: link cloaking, redirect types, click tracking, and the ability to insert links directly from the editor. You’ll see a new Affiliate Links menu item appear in the dashboard after activation. It carries a strong 4.6-star rating on the ThirstyAffiliates WordPress plugin page, for what it’s worth alongside the install-count comparison above.

Go to Affiliate Links → Add New. You’ll see a form that looks similar to the post editor.

  • Title: Give the link a descriptive name — this is what you’ll search for when inserting it into content later. Use the product name or something you’ll remember.
  • Destination URL: Paste the full raw affiliate URL here, including all tracking parameters. This is the URL provided by the affiliate programme.
  • Slug: ThirstyAffiliates generates a slug from the title by default. It becomes the path in your cloaked URL: yourdomain.com/recommends/slug. Edit this to keep it short and clean.
  • Redirect Type: Leave as 302 (temporary) for most affiliate links. A 301 permanent redirect tells search engines that the destination is canonical, which you generally don’t want for a monetised link.

Click Publish to save.

Step 3 — Configure Link Behaviour

Before inserting links into content, set a few defaults under ThirstyAffiliates → Settings.

  • Link prefix: The segment after your domain in cloaked URLs. The default is recommends/. You can change this to go/, out/, or whatever fits your site.
  • No-follow: Set links to nofollow by default. This tells search engines not to pass authority to affiliate merchants through your links, which is correct practice for paid links.
  • Open in new tab: A matter of preference. Most affiliate marketers set links to open in a new tab so the referring content stays open.

When writing or editing a post, click the TA button in the block editor toolbar. A search field appears — type the name of the affiliate link you created, select it from the results, and it’s inserted as a proper anchor tag. You don’t need to copy and paste raw URLs into post content.

If you need to change the destination URL later, update it once in Affiliate Links and it updates automatically in every post where that link appears.

Practical Tips

  • Group links by programme: ThirstyAffiliates lets you create categories for your affiliate links. Keeping Amazon, software, and hosting links in separate groups makes it easier to audit or remove a programme later.
  • Add disclosure text near the top of each post: A short statement — “This post contains affiliate links. If you purchase through these links, I may earn a small commission at no extra cost to you” — satisfies most programme terms and regulatory requirements.
  • Don’t over-link: Three to four affiliate links per post is usually enough. Filling a post with links dilutes the value of each one and can feel promotional rather than helpful.
  • Check links periodically: Affiliate programmes change their URLs or close without warning. Set a reminder to check your most-linked products every few months to catch broken links before they affect reader experience.

Common Mistakes

Using raw affiliate URLs directly in posts. This makes future updates painful and exposes your tracking parameters. Always go through ThirstyAffiliates or a similar tool.

No disclosure statement. In most countries, including the UK and US, failing to disclose affiliate relationships is a legal and regulatory issue, not just a best practice. Add it before publishing.

Applying nofollow incorrectly. Links that compensate you — including affiliate links — should be nofollow. Some plugins default to dofollow. Check the settings on installation.

Linking to products you haven’t used. Affiliate links work when readers trust your recommendations. Linking to anything that earns a commission, regardless of quality, erodes that trust quickly.

Plugin Management vs Manual Links

You can add affiliate links manually as plain anchor tags in WordPress without any plugin. For a site with a handful of links across a few posts, this is technically fine. As the number of posts and programmes grows, manual management becomes unreliable — a single URL change requires searching the entire post archive.

For a site that’s just getting started with monetisation, a plugin is worth setting up from the first affiliate link — it’s far easier than migrating links later. If you’re also exploring display advertising as a revenue stream alongside affiliate marketing, setting up Google AdSense on WordPress works independently of affiliate links and is worth considering once you have consistent traffic.

Once your affiliate links are in place, make sure you also have a disclosure page on your site — the FTC requires transparency about affiliate relationships for any US-facing website.

Once you’re consistently driving traffic through affiliate links, consider reaching out to those brands about paid sponsorships. Our guide to attracting sponsors for your WordPress website walks through creating a media kit, setting rates, and handling disclosure requirements.

If you’re setting this up, it’s worth also reading our guide on accept donations.

Conclusion

Install a dedicated affiliate link plugin, add your affiliate URLs through the dashboard, and insert them via the editor button rather than pasting raw links. Get your disclosure text in place before publishing. Managing links through a plugin from the start saves a significant amount of time as your content library grows.