← All posts

Switching your affiliate links to tracked branded URLs

How to set up WB Ad Manager's link cloaker to replace raw affiliate URLs with branded /go/ slugs, count clicks per link, and update destination URLs without editing every article.

Raw affiliate URLs are a solved problem, and the solution should not cost you a monthly SaaS subscription. WB Ad Manager’s link cloaker turns long, tracking-laden URLs into clean branded short links, tracks every click server-side, and lets you update a destination in one place when a merchant changes their URL. This guide covers the full setup from installing the feature to reading your first click reports.

What the cloaker does

A cloaked link is a server-side redirect. When a reader clicks yoursite.com/go/coursera-react, your server receives the request, logs the click, and immediately redirects the visitor to the actual affiliate URL. The visitor lands on the merchant’s site straight away. You get a running click count for every link.

Three practical outcomes:

  1. Cleaner URLs that work better in social sharing, are easier to type, and do not get tracking parameters stripped by copy-paste.
  2. A click count per link so you can see which offers readers actually click, alongside the merchant’s dashboard. Pro adds a referrer breakdown that shows which posts send the clicks.
  3. Single source of truth for destinations - when Amazon changes an ASIN or a merchant restructures their URL, you update one entry in the cloaker and every post linking to that slug picks up the new destination automatically.

What happens on a click

It helps to know what the plugin does between the click and the merchant’s page, because it explains what you can and cannot expect from cloaking.

  1. The reader requests yoursite.com/go/your-slug. WordPress hands the request to the cloaker before it loads any template.
  2. The cloaker looks the slug up. If no link has that slug, the reader sees your site’s 404 page.
  3. If the link exists but is inactive or past its expiry date, the reader gets the fallback you set in Settings.
  4. Otherwise the click is counted and the server sends the reader on with the redirect type you picked for the link, 307 by default.

The response carries no-cache headers, so a browser or caching layer does not freeze an old destination in place. That matters when you change a destination later.

Be clear about what is hidden. Cloaking hides the long URL before the click, in your content and in the link preview. After the click, the browser’s address bar shows the merchant’s address, parameters included, because this is a normal redirect. The hint text in the link editor says the short address stays in the address bar. It does not, so do not rely on it. The post on affiliate link de-cloaking goes into what a reader can still see.

After installing WB Ad Manager (free), go to Links in wp-admin. The cloaker and the ad manager are independent features, and both are included in the free plugin.

Go to Links > All Links and click Add New Link. The fields:

Destination URL. The full affiliate URL including tracking parameters. For example: https://www.amazon.com/dp/B08L5TNJHG?tag=yoursite-20

Slug. The short identifier that goes after /go/ in your branded link. Keep it readable and descriptive: amazon-kindle-paperwhite, coursera-react-course, bluehost-hosting. Avoid generic slugs like link1 - you will not remember what they are in six months.

Name. An internal label for your own reference. This is what shows in the links list.

Redirect type. Choose 301, 302 or 307 per link. The plugin defaults to 307, a temporary redirect, which suits affiliate links because merchants change destinations. A 301 is permanent and gets cached hard, so pick it only for a link that will never move. What Google’s guidance on affiliate links asks for is the rel attribute, not a particular redirect code, and the plugin can print the rel attributes you ticked for the link when you place it with the link shortcode.

Description. Optional field for tracking commission rates and merchant program details. Set the end date of a promotional link in the separate Expiration Date field.

Save the link. Your branded URL is now live at yoursite.com/go/your-slug.

Choosing the prefix before you publish

Under Settings, the Link Cloaking section has a Cloak Prefix field. The default is go, which gives addresses like yoursite.com/go/your-slug. Change it to recommends, visit or anything your readers will not find odd, and the plugin refreshes your rewrite rules for you.

Decide this early. Only one prefix is active at a time, so links you have already shared under the old prefix stop resolving when you change it. If you are importing links from another plugin, set the prefix to match theirs first, then import.

In any post or page, link to the branded URL the same way you would link to any other page. In the block editor, highlight the text, click the link button, and type or paste yoursite.com/go/your-slug.

The cloaker intercepts requests to /go/ paths automatically - no shortcode, no special formatting required. One difference: the plugin only prints the nofollow and sponsored attributes when it outputs the link itself, with the link shortcode. A raw address pasted into the editor redirects and counts clicks, but carries no rel attribute from the plugin, so add one in your editor’s link settings or use the shortcode for affiliate links. Every click on that link is tracked regardless of whether the reader is on the homepage, a single post, a category archive, or a search results page.

Step 4: Read the click counts

After your first links are live and getting traffic, go to Links > All Links. The Clicks column shows a running total for each link, and you can sort by it.

What you seeWhere
Total clicks per linkFree, in the Links list
Top referrers (posts and pages)Pro, in advanced link analytics
Country and device breakdownsPro, in advanced link analytics

The click total alone already tells you which offers are worth keeping. The referrer data in Pro is the most actionable metric for content decisions. If your referrer report shows that one article from two years ago is sending 60% of clicks to your top affiliate program, that article deserves a refresh, a featured spot in your navigation, and internal links from newer posts.

If the referrer report shows an even spread across 40 posts with no standout performer, that is a different signal - distribution is good but no single piece of content has broken through. Focus on building depth on the topics around your best-performing affiliate programs.

Updating a destination when a merchant changes their URL

This is where the cloaker pays for itself on a long-running content site.

Go to Links > All Links, find the link, and click Edit. Change the destination URL field. Save. Every post and page on your site that links to that slug now redirects to the new URL automatically. No search-and-replace across the post database. No broken links in old articles.

For a content site with three or more years of posts and multiple affiliate programs, this scenario comes up several times a year. Merchants restructure URLs, rename products, change program platforms, or shut down entirely. Managing this at the slug level rather than the post level is the architectural advantage of cloaking.

If you are switching from ThirstyAffiliates or Pretty Links, WB Ad Manager Pro includes a CSV importer. Export your links to CSV from the old plugin, rename the header row to the columns the importer expects (name, destination_url and slug; a sample file shows them), and import.

The cloaking prefix is configurable, so if your current links use /recommends/ or a custom prefix you can keep the same paths. Existing backlinks and internal links do not break because the redirects pick up the same slugs.

The import is a one-time operation. After import, manage all links through WB Ad Manager.

Moving a long-running site, in order

A site with years of posts and several affiliate programs should not switch everything in one afternoon. This order keeps the risk low.

  1. List what you have. Search your content for the domains of your main programs. Note how many posts use each. Pro has a link scanner that finds raw affiliate URLs already sitting in your content; on the free plugin the search is manual.
  2. Start with the biggest earner. Create one cloaked link for your best program, use it in one post, and test it.
  3. Label the links. The Link Type field (Affiliate, Guest Post, External, Internal, Paid Link, Link Exchange, Sponsored Post) is only a label for filtering and reporting. It does not change how the redirect works, but it makes the list manageable at 200 links.
  4. Group them. Put links in categories such as “Hosting” or “Books” so you can filter the list and print a whole group with a shortcode.
  5. Replace the old URLs in the posts that matter. Swap raw URLs for the branded ones in your best-traffic posts first, then work down.
  6. Keep a log. Note which posts you have finished. The scanner in Pro helps here; on the free plugin a spreadsheet does the job.

Take a week or two over it. Nothing breaks while the old raw links remain, so there is no deadline, and any link you have not switched is simply the same as before.

Test every new link once, from outside your admin session.

  • Open a private window and visit the branded address. You should land on the merchant’s page.
  • Open the browser’s developer tools, look at the network tab and confirm the first response is a 307 (or whichever type you chose) with the destination in its location header.
  • Return to Links > All Links and confirm the Clicks column went up by one.
  • Visit a slug that does not exist and confirm you get your normal 404 page.

Be aware that the free counter does not filter bots and link previews. Any request that reaches the redirect is counted, so a busy post may show a few more clicks than real people made. Treat the number as a guide to relative popularity, and compare it with the merchant’s dashboard for the real picture.

For wording and placement of the disclosure that must sit near each link, see affiliate link disclosure. To retire a link when a deal ends, read expiring affiliate links after a promotion. The link cloaking page lists everything the cloaker does, and the affiliate link cloaker use case walks through a complete setup.

A few common questions

Does cloaking affiliate links violate AdSense policies?

No. Google’s AdSense policy prohibits cloaking links to AdSense ads. It does not prohibit cloaking affiliate links to merchants like Amazon, Shopify, or Booking.com. WB Ad Manager uses a standard temporary redirect with no DOM injection or interstitial. Compatible with AdSense by default.

Should I nofollow all cloaked affiliate links?

Yes, and the plugin gives you the controls. Google recommends rel="sponsored" for paid and affiliate links, with nofollow as the older alternative. In the link editor there is a checkbox for each. New links come with nofollow ticked and sponsored not ticked, so tick sponsored on every affiliate link. These attributes are for search engines. They do not replace telling your readers about the relationship, which the FTC expects to be visible next to the recommendation itself.

What if I want to rotate between two merchants for the same product category?

Neither the free nor the Pro plugin rotates one short link between several destinations, so there is no built-in even or weighted split between merchants. To compare two merchants, create two links with different slugs, use each in similar posts and compare their click totals. A developer can also change the destination at redirect time with the wbam_link_redirect_url filter, but that is custom code, not a setting.

Can I set an expiry date on a promotional link?

Yes. Set a date in the Expiration Date field and the link stops redirecting at that moment. By default it then returns a 404 page, and in Settings you can send visitors to your home page or to a fallback URL instead. Useful for limited-time promotional URLs that would lead to a dead page on the merchant’s side after the promotion ends.

Getting started today

The link cloaker is part of the free WB Ad Manager plugin, with no monthly fee. If you have ThirstyAffiliates or Pretty Links installed, Pro includes a CSV importer, so you can export the old links and bring them across in one file.

For a guide to setting up display ad zones on the same install - getting banners into your sidebar, in-article, and header positions - see our post on placing your first ad zones.