# How to Cloak Affiliate Links in WordPress

You cloak affiliate links in WordPress by swapping long tracking URLs for short paths on your own domain. You publish something like `yoursite.com/go/product` instead of `https://example.com/ref?id=12345&sub=abc`. Link Manager Pro stores the real affiliate destination, redirects each click to that URL, and lets you update the destination later without hunting through old posts. You pick the slug (the `go/product` segment), configure the redirect type, set `rel` attributes, and optionally forward query parameters. The masked URL works as soon as you save the link. You perform every step inside **Link Manager Pro → Links**; you never hand-edit `.htaccess` for basic affiliate hops.

## The problem

Raw affiliate URLs look messy, expose opaque tracking parameters, and age badly when programs change query strings or domains. Readers hesitate to click long, unfamiliar strings. You also lock yourself into hard-coded URLs across your content whenever the merchant updates a link.

## The solution: masking with Link Manager Pro

**Link cloaking** (masking) means you replace the visible URL with a branded path on your site while Link Manager Pro handles the hop to the affiliate program behind the scenes.

**Why you cloak:**

- **Trust** — Short, on-brand URLs look intentional and easier to verify.
- **Click-through** — Clean links reduce friction compared with parameter-heavy URLs.
- **Sharing** — You paste a memorable path in email, social posts, or PDFs.
- **Maintenance** — You edit the destination in one place; posts that already use the masked URL keep working.

## Step-by-step: cloak a link

1. Go to **Link Manager Pro → Links → Add New**.
2. Enter the **affiliate destination URL** (the full program URL with your tracking).
3. Set a **custom slug** — the part after your prefix (for example `product` in `yoursite.com/go/product`). You configure the prefix (for example `go`, `link`, `refer`) under **Settings**.
4. Choose a **redirect type**:
   - **301** — permanent; search engines treat the masked URL as the canonical hop.
   - **302** — temporary; use when you expect the destination to change.
   - **307** — temporary like 302, but preserves the original HTTP method (POST stays POST).
5. Set **link attributes**. For affiliate links, enable **nofollow** and **sponsored** so search engines and policies treat the hop as paid or sponsored.
6. Optionally enable **parameter forwarding** so query strings on the masked URL pass through to the affiliate (for sub-IDs or campaign tags).
7. **Save**. The cloaked link goes live immediately.

## Best practices

- Pick **descriptive slugs** (`hosting-deal`, `spring-sale`) so you recognize links in analytics and exports.
- Keep **sponsored** on affiliate hops alongside **nofollow** unless your counsel advises otherwise.
- Use **301** for stable, long-term affiliate destinations; use **302** when the merchant rotates landing pages often or you A/B test destinations.

### Prefix and slugs

You set the **link structure prefix** once under **Settings** (for example `go`, `link`, or `refer`). Every masked URL uses that prefix plus your slug. **Plan the prefix before you print URLs**—changing it later breaks every existing masked link readers already bookmarked or shared.

### Parameter forwarding in real life

You enable **Forward URL Parameters** when you append tracking on the fly—`yoursite.com/go/product?sub=newsletter`—and you need the affiliate network to receive `sub=newsletter` on the final hop. Leave forwarding off when extra query strings might confuse the merchant’s tracking or violate program rules.

### Putting cloaked URLs in content

After you save the link, paste the masked URL (or rely on **auto-linking** keywords) inside posts, pages, and widgets. Link Manager Pro still tracks clicks and honors the `rel` values you set. For program compliance, pair technical attributes with visible disclosure copy—see [Affiliate disclosure](https://docs.linkmanagerpro.com/features/disclosure).

For deeper detail on how masking fits SEO and disclosure rules, see [Link masking & URL cloaking](https://docs.linkmanagerpro.com/features/link-masking), [Creating links](https://docs.linkmanagerpro.com/user-guide/creating-links), and [Affiliate disclosure](https://docs.linkmanagerpro.com/features/disclosure).

## Related

- [Link masking & URL cloaking](https://docs.linkmanagerpro.com/features/link-masking)
- [Creating links](https://docs.linkmanagerpro.com/user-guide/creating-links)
- [Affiliate disclosure](https://docs.linkmanagerpro.com/features/disclosure)
