# Link Masking

> **TL;DR:** You replace long destination URLs with short branded links on your own domain (e.g., `yoursite.com/go/product`). Link Manager Pro handles the redirect using 301, 302, or 307 status codes. You control the slug prefix, link attributes, and parameter forwarding from one dashboard.

Replace destination URLs with short, readable links that use your own domain.

## What Is Link Masking?

Link masking hides the actual destination URL behind a short, readable link that uses your own domain. When a visitor clicks the masked link, Link Manager Pro looks up the destination and redirects them instantly.

### Before and After

**Before:**

```
https://www.amazon.com/Echo-Dot-Generation-Smart-Speaker/dp/B07PZMDQHW/ref=as_li_ss_tl?ref=XYZ&tag=your-affiliate-id-20&linkCode=ll1&linkId=abc123
```

**After:**

```
https://yourwebsite.com/link/amazon-echo-dot
```

## How It Works

1. You create a link with a destination URL and a slug (e.g., `amazon-echo-dot`).
2. When you save or update a post, Link Manager Pro scans the post content for external links.
3. Matching URLs are replaced with their masked equivalents.
4. REL attributes (e.g., `nofollow`, `sponsored`) are applied from your global settings and any domain-level overrides.
5. When a visitor clicks the masked link, Link Manager Pro redirects them to the destination. The click is recorded for analytics.

## Configuring the Link Prefix

The default prefix is `/link/`. You can change it to match your brand.

1. Go to **Link Manager Pro → Settings → General**.
2. Find **Link Structure Prefix**.
3. Enter your preferred prefix (e.g., `go`, `refer`, `recommend`).
4. Click **Save Changes**.

**Example** — with prefix `refer` and slug `hosting`:

```
yourwebsite.com/refer/hosting
```

> **Warning:** Only change the prefix during initial setup. Changing it later breaks all existing masked links.

## Masking Internal Links

Link Manager Pro can also mask internal links within your post content. This gives you click tracking and consistent link management for links pointing to pages on your own site.

1. Go to **Link Manager Pro → Settings → General**.
2. Enable **Mask Internal Links**.
3. Set the **Internal Mask Prefix** to a value that differs from your external prefix (e.g., `go`).
4. Click **Save Changes**.

Internal links in your post content are then rewritten using the internal prefix when you save a post.

## Forwarding Query Parameters

Enable **Forward URL Parameters** on any link to pass query parameters from the masked URL through to the destination.

**Example** — a visitor clicks:

```
yoursite.com/link/product?ref=email&promo=spring
```

With **Forward URL Parameters** enabled, the destination receives:

```
https://example.com/product-page?ref=email&promo=spring
```

This is useful for passing attribution data, coupon codes, or tracking IDs directly to the destination.

## Password-Protected Links

You can gate any masked link behind a password. When a visitor clicks a password-protected link, they see a password prompt before the redirect happens.

1. Edit the link you want to protect.
2. Set a value in the **Password Protection** field.
3. Save the link.

Visitors who enter the correct password proceed to the destination. Visitors who do not have the password cannot access the redirect.

## Link Scheduling

Control when a link is accessible using scheduling fields:

| Field | Description |
|-------|-------------|
| **Active From** | Date and time when the link becomes accessible |
| **Expires At** | Date and time when the link stops working |

A visitor who clicks a scheduled link outside the active window does not get redirected. Use scheduling for time-limited promotions, product launches, or seasonal campaigns.

## Redirect Types

You can control how the browser handles each redirect. Set a global default under **Link Manager Pro → Settings → Redirection Matrix**, or override it per link.

| Type | Behavior |
|------|----------|
| **301** | Permanent redirect. Browsers and search engines cache this. Use for links that will not change. |
| **302** | Temporary redirect. The browser does not cache. Use when the destination may change. |
| **307** | Temporary redirect that preserves the original request method. Use when you need strict method preservation. |

The default redirect type is **301**. If a link does not have a per-link override, the global default applies.

## Conditional Routing

You can add rules to a link that change the redirect destination based on conditions like total click count, visitor country, or date range. When a visitor clicks the link, Link Manager Pro evaluates the rules in priority order and redirects to the first matching rule's destination. If no rule matches, the default destination is used.

Each rule can also override the redirect type independently.

To add rules, edit a link and open the **Conditional Routing Rules** section.

## Organizing Links with Categories and Tags

Keep your links organized by assigning **categories** and **tags**:

- **Categories** — group links by type (e.g., "Affiliate", "Social", "Internal").
- **Tags** — add descriptive labels for filtering (e.g., "Q1 Campaign", "Partner A").

You can filter and search links by category or tag from the main link list.

## Tips

- Test links after creating them.
- Keep slugs short and descriptive.
- Use categories and tags to organize links at scale.
- Enable **Forward URL Parameters** only when the destination expects query parameters.
- Set **Active From** and **Expires At** for time-sensitive promotions.

---

**Step-by-step guide:** [How to Cloak Affiliate Links in WordPress](https://docs.linkmanagerpro.com/guides/cloak-affiliate-links)
