# Manage affiliate links

Keep affiliate links up to date: find a partner's links, change your tag, and handle a partner that moves or ends its program.
Page: https://docs.linkmanagerpro.com/tutorials/manage-affiliate-links
Use when someone asks: manage affiliate links wordpress; add affiliate tag to all links; change affiliate tag wordpress; affiliate link manager plugin
Intent: How-to / Commercial
Also searched as: affiliate link management; affiliate link manager; manage affiliate links; affiliate link tracking

Affiliate link management in WordPress with Link Manager Pro starts with one habit: keep each partner as an affiliate and put every link to it in your posts as a short link. Then one edit to a short link's **Destination URL** fixes every post, email and QR code that uses it. This tutorial covers the upkeep: finding a partner's links, changing your tag, a partner that moves or closes its program, broken links and comparing partners.

Setting up a partner and its first link is in [Cloak an affiliate link](https://docs.linkmanagerpro.com/tutorials/cloak-affiliate-links). This tutorial starts after that.

## Before you start

- You need access to Link Manager Pro. Administrators always have it, and editors only when an administrator allows it ([Access for editors](https://docs.linkmanagerpro.com/guides/access)).
- Each partner should be an affiliate under Link Manager › Affiliates. Its numbers count every short link whose destination is on its domain, including links made before you added it ([Affiliates](https://docs.linkmanagerpro.com/guides/affiliates)).
- There are no bulk edits. You change each short link in its own form, and the search below takes you to each one quickly.

## Find every link to a partner

To find all your links to a partner, search for its domain in the Short Links list. The search looks inside each link's **Destination URL**, so it lists every short link to that partner, whether you made it in the form, from the editor or by masking a post.

Link Manager › Short Links

1. Enter the partner's domain in **Search short links…**, for example `outdoor.example.com`.
2. Read the count under the list, like "Showing 10 of 328 short links". Each row shows its destination under the slug.
3. Select **Edit** on a row to change that link. **Save changes** keeps you on the list, which reloads with your search.

The search matches any part of the text, so `example.com` also finds `shop.example.com`, and keywords or [other addresses](https://docs.linkmanagerpro.com/guides/other-addresses) that contain it ([Search short links](https://docs.linkmanagerpro.com/guides/managing-links#search-short-links)).

The partner's report gives a second view, sorted by clicks. In Link Manager › Affiliates, select the partner's row, then **Short links** under **Where clicks start**. It lists the links with the most clicks first, five to a page, each with its destination. It counts every short link to the domain.

[Redirects](https://docs.linkmanagerpro.com/features/redirects) to the partner aren't short links, so neither list shows them. Find them with **Search by source or destination…** under Link Manager › Link Intelligence › Redirects, and change each one with **Edit** on its row.

## Organize affiliate links with categories and tags

Categories and tags group links in your admin; visitors never see them. Use them for groups a domain search can't find, like all your hosting partners, and combine a **Category** or **Tag** filter with the domain in the search. A tag like `retag` also marks a cleanup in progress, the to-do list idea on [Categories and tags](https://docs.linkmanagerpro.com/guides/categories-tags#get-more-out-of-it).

Links that don't come from the short link form, for example masked links or links made with the editor's buttons, start with no category or tag. Add them in each link's form. No report adds up clicks by category or tag, so compare partners on the Affiliates screens.

## How do you change an affiliate tag on existing links?

Change the tag on the affiliate first, then on each old link. The affiliate gives the new tag only to short links created from now on. Links you already have keep the URL they were saved with, old tag included, until you edit them.

Link Manager › Affiliates

1. Select **Edit** (the pencil) on the partner's row.
2. Paste one of your affiliate links with the new tag into **Affiliate URL** (1). The line under the field says how many existing links keep their URL.
3. Check the line below it (2): it names the domain and the new tag. Its example puts a `/` before the tag, which saved links don't get. Select **Save changes**. **Affiliate saved.** appears.

[Screenshot: The Edit affiliate dialog for an example partner, marked: 1 the Affiliate URL field with a new ref tag and the line saying the 328 existing links keep their URL, 2 the line saying links to the domain get the new tag]

4. Go to Link Manager › Short Links. Search for the old tag as it appears in your links, with its name, like `ref=yoursite-21`. A bare value like `21` matches far more links.
5. Select **Edit** on a row. In **Destination URL**, replace the old tag with the new one, and select **Save changes**. Editing never adds the tag for you, so type it in.
6. Repeat until the search finds no more links. An edited link drops out of the results once nothing in it contains the old tag.

A link's **Routing rules** each have their own **Destination URL**. The search doesn't look in them, and the tag is never added there. So when you edit a link that has rules, open **Routing rules** and change the tag in each rule's destination too. The link's report shows how many it has, under **Link details** ([Link report](https://docs.linkmanagerpro.com/guides/link-report#link-details-other-addresses-and-the-qr-code)). Redirects to the partner need the same change (see [Find every link to a partner](#find-every-link-to-a-partner)).

To check one link, select **Copy link** in its report and open it in a private window. The address bar shows the partner's page with the new tag. The test counts as a click. To go back to the old tag, edit the **Destination URL** again the same way.

The next click on each edited link goes out with the new tag. Your posts don't need to change, because they use the short link. If your tag is a path, like `/ref/yoursite`, search for that path instead.

The affiliate's **UTM parameters** and keywords need no per-link edits: they reach old links too ([what an affiliate changes](https://docs.linkmanagerpro.com/guides/affiliates#what-an-affiliate-changes-on-clicks-and-in-posts)).

## What to do when a partner changes its domain

When a partner moves to a new domain, point the affiliate at the new domain, then change each link's destination. Until you change a link, it still goes to the old domain and no longer counts for the affiliate.

1. Go to Link Manager › Affiliates and select **Edit** on the partner's row. Paste an affiliate link on the new domain into **Affiliate URL**, and select **Save changes**.
2. Go to Link Manager › Short Links and search for the old domain.
3. Edit each link's **Destination URL** to the new domain, with your tag typed in, and save. Change the destinations of its **Routing rules** too, and of any redirects to the old domain: the search doesn't find those.

If saving the affiliate says "new.example.com is already an affiliate (Partner name). Edit that affiliate instead.", another affiliate has the new domain already. Each domain can have only one.

The affiliate's numbers follow each link's current destination. After step 1 they count only links on the new domain, and each link you move in step 3 brings its past clicks back with it. The affiliate's keywords move to a short link for the new **Affiliate URL**. The old one keeps its destination, and the search in step 2 finds it too.

If the old domain still forwards visitors to the new one, your old links work in the meantime.

## What to do when an affiliate program ends

When a program ends, decide per link what readers should get. Changing the destination keeps your posts working, expiring stops the link and keeps its report, and deleting removes the link with its history.

::: warning
Deleting a short link deletes its clicks, routing rules and other addresses, and there's no trash ([Delete a short link](https://docs.linkmanagerpro.com/guides/managing-links#delete-a-short-link)). Deleting the affiliate deletes its keywords, link attributes and UTM values, and can't be undone either. Back up first if you might need them ([Back up and restore](https://docs.linkmanagerpro.com/guides/backup-restore)).
:::

| You want to | Do this | Visitors get | The link's clicks |
|---|---|---|---|
| Send readers somewhere useful | Change **Destination URL** to another partner or a page of yours | The new page | Kept. They now count for the new destination's affiliate, if it has one |
| Stop the link, keep its report | Set **Expires** under **Schedule & access** | Whatever WordPress shows at that address, usually your 404 page | Kept |
| Remove the link | **Delete** in the Short Links list | Whatever WordPress shows at that address, usually your 404 page | Deleted with the link |

A new destination on another partner's domain doesn't get that partner's tag when you edit, so type it in. An expired link's keywords still turn into links in your posts, and those lead to the 404 page: turn off **Replace keywords automatically** on the link too ([expire a link](https://docs.linkmanagerpro.com/guides/managing-links#get-more-out-of-it)).

Then stop the partner's own keywords. In Link Manager › Affiliates, select **Edit** on the partner's row, open **Auto-linking**, turn off **Replace keywords automatically** and select **Save changes**. The affiliate and its report stay.

Deleted a short link that posts still use? Fix its old address, like `/link/tent-deal`, with a redirect. Select **Scan content** in Link Health: when a post links to that address in full, it's listed under **In your content**, and **Fix with a redirect** sends it to a page that works ([Find and fix broken links](https://docs.linkmanagerpro.com/tutorials/find-broken-links)). A [redirect](https://docs.linkmanagerpro.com/features/redirects) can't catch the partner's own domain, because it answers only addresses on your site. Changing the destination instead of deleting saves this step.

## Check affiliate links for broken destinations

Link Health checks the short links in your posts through their **Destination URL**, so a partner page that's gone shows up after a scan. It never opens the short links themselves, so a scan adds no clicks.

Link Manager › Link Intelligence › Link Health

1. Select **Scan content** and keep the page open until the end message.
2. Select the **In your content** tab. A row with "Via short link" is a short link whose destination is broken.
3. Select **View link** on that row (or, when the row names several short links, the one you want in the row), then **Edit short link** (the pencil) on the link's report, and change the **Destination URL**. Every post that uses the link is fixed at once.

The full steps, and how to check a fix, are in [Find and fix broken links](https://docs.linkmanagerpro.com/tutorials/find-broken-links). Some dead affiliate links don't show up there:

- Only a `404` (not found) or `410` (gone) answer counts. A partner that sends ended products to its home page, refuses checkers with a `403`, or a domain that no longer exists isn't listed.
- A scan reads links saved in your posts' content. Links your keywords make appear only when a post is shown, and links you shared in emails or on social media aren't in any post. A short link used only there isn't checked.
- More than 10 links to the same site in one batch of posts aren't all checked, and the scan ends "Not fully checked". Select **Scan content** again right away: each run gets further ([why](https://docs.linkmanagerpro.com/features/health-monitoring#why-does-a-scan-say-not-fully-checked)).

So now and then, test your partners' most-clicked links yourself. Select **Copy link** on a row of the report's **Short links** tab, and open the link in a private window. Each test counts as a click.

## Compare partners in the affiliate report

The Affiliates list compares partners side by side, with each one's **Short links**, **Clicks** and **Unique clicks**, all time. On the Dashboard, **What’s working** has an **Affiliates** tab that ranks your five most-clicked partners. A partner's own report shows its trend and where its clicks start ([Read an affiliate's click report](https://docs.linkmanagerpro.com/guides/affiliates#read-an-affiliate-s-click-report)).

Keep these limits in mind when you compare:

- The Affiliates screens count all time; they have no date range. The Dashboard's **Affiliate clicks** follows the date range, but adds all partners together ([Dashboard](https://docs.linkmanagerpro.com/guides/analytics)).
- A link counts for the partner its destination is on now. Repoint a link, and its past clicks move to the new partner.
- Each partner counts every short link to its domain. Visits through a [redirect](https://docs.linkmanagerpro.com/features/redirects) to the partner don't count.

## Details

When a change reaches your links:

| You change | When it takes effect |
|---|---|
| The **Affiliate link prefix** in [General settings](https://docs.linkmanagerpro.com/guides/settings/general#affiliate-link-prefix) | The address shown and inserted for short links to the partner's domain, from then on. Links already written in posts change only when you select **Update links in posts** next to the field |
| The tag in the affiliate's **Affiliate URL** | Only on short links created from now on, when the tag is missing. Existing links keep the URL they were saved with |
| The affiliate's **Redirect type** | Only on short links created from now on |
| The affiliate's **UTM parameters** | From the next click, on old and new links |
| The affiliate's keywords or **Replace keywords automatically** | The next time a post is shown |
| The affiliate's **Link attributes** | Its keyword links: the next time a post is shown. Masked links: when they're masked; links masked earlier keep the `rel` they got |
| A short link's **Destination URL** | From the next click. Posts that use the link stay as they are |
| A routing rule's **Destination URL** | From the next click that the rule matches. It never gets the affiliate's tag, and the Short Links search doesn't look in it |

- No WP-CLI command changes your links' destinations or edits affiliates ([WP-CLI commands](https://docs.linkmanagerpro.com/guides/wp-cli)).
- **Search short links…** looks in the slug, the **Destination URL**, keywords and other addresses.

## Get more out of it

- Put partner links in posts only as short links. A link pasted straight into a post has to be edited in that post; a short link is fixed in one place. With **Mask links when saving posts** on (the default), links already in your posts can become short links too ([Cloak the affiliate links already in your posts](https://docs.linkmanagerpro.com/tutorials/cloak-affiliate-links#cloak-the-affiliate-links-already-in-your-posts)).
- Before a program ends, open the partner's report and the **Posts** tab under **Where clicks start**. It lists the posts that sent clicks to the partner, so you know which posts may need new wording, not only a new link. Posts with the link but no clicks aren't listed.
- Pause a seasonal partner with **Expires** instead of deleting. The link and its report stay; clear the date when the season comes back. Turn **Replace keywords automatically** off on the link while it's expired.
- Add an affiliate even for a partner without a tag. Paste the bare `https://partner.example.com/` as its **Affiliate URL**, and the partner gets its own row and report. New affiliates start with `nofollow` and `noopener` ticked, and those ticks replace your site's rel settings on masked links to that domain ([Link attributes in your posts](https://docs.linkmanagerpro.com/guides/affiliates#link-attributes-in-your-posts)).

## If something goes wrong

- If a new short link still has the old tag, then its destination already had the tag's parameter when you created it. A value you type is never replaced: edit the link's **Destination URL**.
- If an affiliate's numbers dropped after you changed its domain, then its links still point to the old domain. Search for the old domain and change their destinations.
- If saving the affiliate says the domain "is already an affiliate", then another affiliate has that domain. Edit that one instead.
- If a dead partner page isn't in Link Health, then it didn't answer `404` or `410`, or the link isn't in a post's saved content. Open its **Destination URL** directly in a private window: opening the short link would count a click.
- If some visitors still reach the old tag or the old domain, then a routing rule or a redirect still points there. Open the link's **Routing rules**, and search under **Redirects**.

More fixes are on [Troubleshooting](https://docs.linkmanagerpro.com/troubleshooting).

## Related

- [Cloak an affiliate link](https://docs.linkmanagerpro.com/tutorials/cloak-affiliate-links)
- [Affiliates](https://docs.linkmanagerpro.com/guides/affiliates)
- [Find and fix broken links](https://docs.linkmanagerpro.com/tutorials/find-broken-links)
- [Categories and tags](https://docs.linkmanagerpro.com/guides/categories-tags)
- [Troubleshooting](https://docs.linkmanagerpro.com/troubleshooting)
