Cloaking a Link: What it is, When to use it, and How to do it right
Last updated:
ShortPen University

LucaG is the co-founder of ShortPen. Before that, he built Guadagnissimo from scratch, a personal finance blog that reached hundreds of thousands of readers per year and was later acquired. That experience is where he learned SEO and marketing attribution hands-on. He also runs NTSOT, a newsletter on tools for work and life. His background spans product design, growth, and building online businesses.
Show more
Long affiliate URLs and parameter-stuffed tracking links break trust before anyone clicks. Readers see a string of random characters, hesitate, and bounce. Cloaking a link fixes that by replacing the messy destination with a clean, branded URL on a domain you control.
The technique is simple, but the surrounding confusion is not. Most guides treat link cloaking as either a black-hat trick or a tutorial on a WordPress plugin.
Few answer the question every reader actually has: will this hurt my rankings, get me banned from Amazon, or break my Facebook ads?
This guide answers all three. You'll get a clear definition of what cloaking does, the difference between the two methods that share the name, the right setup across any stack, and a decision framework for when cloaking helps and when it adds friction.
What link cloaking actually means

Link cloaking is the practice of hiding the destination URL of a link by routing it through a clean, branded URL you own.
The reader sees yoursite.com/recommends/tool instead of affiliate-network.com/r.cfm?b=1234567&u=987654&afftrack=. Both lead to the same place. Only one feels safe to click.
There's a detail almost every guide skips: there are two technically different methods that share the name "cloaking."
Redirect-based cloaking
The most common method. You create a clean URL on your domain and configure it to redirect to the destination. When someone clicks, they land briefly on your branded URL, then get sent to the final page. The address bar updates to show the destination after the redirect completes.
This is what Pretty Links, ThirstyAffiliates, and most modern link platforms do by default.
Iframe-based cloaking
A more aggressive method. The destination loads inside an iframe, so the cloaked URL stays in the address bar permanently. The user never sees the real destination URL.
This sounds better in theory, but it has a major limitation: many websites block themselves from being loaded in iframes using the X-Frame-Options header. Apple, banks, and most e-commerce platforms refuse to load this way. When that happens, the cloaked link breaks. Iframe-based cloaking also gets flagged faster by ad platforms because the displayed URL never matches the actual destination.
A concrete before/after
Before cloaking: https://shareasale.com/r.cfm?b=1234567&u=987654&m=12345&urllink=&afftrack=
After cloaking: https://yoursite.com/recommends/cool-tool
Both URLs send the visitor to the same product page. Using affiliate link cloaking not only protects your affiliate ID, but also improves the professionalism and trustworthiness of your links, making them more appealing and reliable for your audience.
Cloaking vs URL shortening vs black-hat SEO cloaking
Three things share overlapping vocabulary, and the confusion costs people sleep. Here's the clean separation.
Cloaking vs URL shortening
URL shortening creates a shorter link on someone else's domain. bit.ly/3xYqZ is a Bitly link. The shortening service owns the domain, the redirect, and the analytics.
Cloaking uses your domain. The branding, the trust signal, and the analytics belong to you. If the shortening service goes down or changes pricing, your links keep working because they're on infrastructure you control.
Most modern link platforms support both: a custom domain (cloaking), and the result is also short (shortening). The two aren't opposites; they're complementary.
Cloaking vs black-hat SEO cloaking
Black-hat SEO cloaking shows different content to Google's crawler than to human visitors. A bot sees a keyword-stuffed page, while a user sees something else.
This violates Google's spam policies and can get a site deindexed.
Affiliate cloaking is fundamentally different. Everyone, including Google's crawler, sees the same destination. The cloaked URL is just a clean front door. Google itself states that redirects for legitimate purposes are explicitly allowed, and a redirect from yoursite.com/recommends/tool to a partner's page falls cleanly into that category.
The two practices share only a word.
Why this matters
Most "is link cloaking bad for SEO?" panic comes from conflating the two. Once you separate them, the answer is simple: cloaking with the right SEO attributes is standard practice and Google-safe.
The correct attribute is rel="nofollow" (or the newer rel="sponsored") on every cloaked affiliate link. These tell Google the link is monetized so the destination doesn't get unearned ranking credit. Most modern link platforms apply these automatically.
Why marketers cloak links

Five reasons that hold up across every quality guide on the SERP.
Cleaner URLs that get more clicks. Branded URLs feel safer than parameter-stuffed strings. Affiliate marketers consistently report higher click-through rates after switching from raw affiliate URLs to branded cloaked ones, especially on social, where the link is visible in the post.
Affiliate ID protection. Commission hijacking is real. Browser extensions and malware can scan a page for affiliate IDs and replace them with the attacker's own. Cloaking masks the ID from view, making it harder to scrape and substitute.
Centralized link management. One cloaked link can sit in 50 blog posts. When the destination URL changes, you update it once, and all references update everywhere.
Better analytics and attribution. A modern link platform gives you click-level data the affiliate dashboard usually doesn't: device, country, referrer, source, and the split between QR scans and direct clicks.
Post-click conversion tracking. This is what separates a basic redirect from real attribution. Cloaked links can pair with a tracking pixel on the destination to capture signups, purchases, demo bookings, or any custom event. We'll cover this in detail below.
Cloaking also has uses beyond affiliate marketing. Agencies white-label client links. B2B teams hide internal UTM parameters from prospects. Creators get cleaner links on QR codes, podcasts, and offline collateral.
How to cloak a link: 3 methods, ranked by who they're for
Three approaches, ranked by complexity and flexibility.
Method 1: A modern link platform (recommended for most people)

This is the fastest path and works on any stack: WordPress, Webflow, Framer, Shopify, custom code, or no website at all.
The workflow:
Sign up for a link platform that supports custom domains and link cloaking (e.g. ShortPen)
Connect your custom domain (e.g.,
go.yourbrand.com).Create a link with your destination URL.
Toggle cloaking on in the link's advanced settings.
Save and share.
In ShortPen, this means going to Links → New Link → Advanced Options → Link Cloaking → On → Save. The cloaked URL keeps your branded domain visible, while the destination is obscured in previews and status bars until the redirect completes. Analytics, UTMs, and event tracking continue to work normally.
Cloaking is a per-link toggle in ShortPen, not a separate plan. The free plan includes one custom domain and the cloaking option, which is enough to test the workflow on a real link.
Method 2: A WordPress plugin
If your content lives on a WordPress site, link cloaking plugins are a user-friendly and accessible option for easy link management.
Pretty Links and ThirstyAffiliates are the dominant choices. Both let you create branded redirect URLs from inside the WordPress dashboard, apply nofollow and sponsored attributes automatically, and track basic click counts.
The trade-off: you’re locked into WordPress, dependent on plugin maintenance, and limited to whatever the plugin supports. If you manage links across multiple sites or want deeper analytics, a link platform scales better.
Method 3: Manual cloaking via .htaccess or PHP
For developers who want zero dependencies. You add a redirect rule directly to your server config.
Apache .htaccess:
Nginx:
Pros: no plugins, no third-party services, total control.
Cons: no analytics, no centralized management, no automatic nofollow attributes, and a typo in .htaccess can take your whole site down. Workable for a handful of links, painful at scale.
Which redirect type to choose
ShortPen supports four redirect types: 301, 302, 307, and 308.
301 (permanent): Use when the destination won't change. Some clients cache 301s and stop checking your link tracker, which can break analytics or rotation logic.
302 (temporary): The default for most marketing campaigns. Clients keep checking the source for the latest destination, so updates and routing rules work reliably.
307 (temporary, method-preserving): Same as 302 but preserves the HTTP method. Useful for webhook tests.
308 (permanent, method-preserving): Permanent equivalent of 307.
For most cloaked affiliate or marketing links, 302 is the safer default. It keeps the redirect dynamic, which matters if you change the destination or add routing logic later.
Cloaking + post-click attribution (the part most guides skip)
Knowing 500 people clicked your cloaked link tells you reach. Knowing that 47 of them signed up tells you what your traffic is actually worth.
Most cloaking guides stop at click counts. That's a mistake. Click data is shallow. Without conversion data, you're optimizing a metric that doesn't pay rent.
How cloaking and a pixel work together
Four steps to combine cloaking with proper attribution:
Cloak the link. Branded URL on your domain, redirect type set, advanced options configured.
Install a tracking pixel on the destination domain. A small JavaScript snippet that loads on the destination page or a thank-you page after a conversion. The ShortPen Pixel takes one snippet to install.
Define the events that matter. Signup, purchase, demo booked, free-trial started, newsletter subscribed. Each event corresponds to a real business outcome.
Enable event tracking on the cloaked link. In ShortPen, this is a toggle on the link itself: it tells the system to attribute conversions on the destination back to clicks on this specific cloaked URL.
The result: your cloaked link is branded, your destination loads cleanly, and your dashboard shows clicks and conversions next to each other.
With detailed analytics and valuable data from conversion tracking, you can optimize your affiliate strategies and confidently answer “did this campaign actually work?” instead of guessing from raw click counts.
Where this matters most
This setup is overkill for a creator dropping affiliate links in a blog post.
It's essential for SaaS founders driving paid traffic to a signup page, B2B teams routing prospects from outbound emails to a demo form, affiliates who also sell their own product alongside affiliate offers, and agencies managing campaigns where client-ready conversion reports matter.
Cloaking without conversion tracking gives you pretty links. Cloaking with a pixel gives you actual attribution.
The Amazon and ad-platform caveats
Three places where cloaking can get you into trouble if you don't pay attention.
Amazon Associates
Amazon is the major exception in the affiliate world. Their Operating Agreement specifically prohibits cloaking that hides the fact a link points to Amazon. Section 6(w) of their Program Policies states that you can't use a link shortener "in a manner that makes it unclear that you are linking to an Amazon Site."
In practice, this means a cloaked URL like yoursite.com/recommends/headphones that redirects to Amazon will get you flagged. Compliant alternatives:
Use Amazon's own
amzn.toshortlinks. They're branded as Amazon, so the destination is implicit.Add a clear text disclaimer next to the link: "Buy on Amazon" or similar.
Use a button image that visibly says "View on Amazon."
Use a plugin with a "smart uncloaking" feature that displays a clearly Amazon-branded URL on the front end.
For every other affiliate program (ShareASale, CJ, Impact, direct programs), cloaking is generally fine.
Facebook Ads, Google Ads, and TikTok Ads
All three ad platforms require the displayed URL to match the destination domain. Iframe-based cloaking gets flagged immediately because the URL never updates. Redirect-based cloaking with a clean branded URL is generally fine, as long as the destination matches what the ad creative promises.
The "FB and Google block cloaked links" claim you'll see in older guides is overstated. They block deceptive cloaking. They don't block branded redirect URLs that lead transparently to the same domain shown in the ad's display URL.
For paid traffic: redirect-based cloaking only, branded domain that matches your ad creative, destination consistent with the ad's promise.
FTC disclosure
Cloaking the URL doesn’t cloak the legal obligation. If a link earns you a commission, US law requires clear and conspicuous disclosure.
Always disclose your affiliate relationships to maintain transparency and trust with your audience, as required by the FTC and similar regulatory bodies.
A branded URL doesn’t change that. Add a disclosure at the top of any post with affiliate links, regardless of whether they’re cloaked.
When NOT to cloak a link

Cloaking is a tool, not a default. There are real cases where it adds friction without value.
Don’t cloak Amazon affiliate links unless your platform has a smart-uncloaking feature that displays the Amazon destination clearly.
Don’t iframe-cloak ad campaign links. They’ll get flagged. Use redirect-based cloaking only for paid traffic.
Don’t use cloaking to deceive. Same destination, same expectation as the anchor text. If the link says “free guide” and leads to a $49 paywall, the cloaking makes the deception worse.
Don’t cloak login or signup links to your own product. There’s no benefit, and some browsers warn on unnecessary redirects.
Don’t cloak internal links between pages on the same domain. Internal navigation should be direct to preserve internal link juice, which is crucial for SEO. Cloaking affiliate links is common, but internal links should always pass link equity naturally.
For one-time recipient links or any link where branding and analytics don’t matter, raw URLs are fine.
FAQ
Is link cloaking legal?
Yes. Cloaking a link with a redirect is standard practice. It becomes a legal issue only if used to deceive. For affiliate marketing, the FTC requires you to disclose the affiliate relationship regardless of cloaking.
Will cloaking a link hurt my SEO?
No, when done correctly. Add rel="nofollow" or rel="sponsored" to cloaked affiliate links so Google knows they're monetized. The black-hat SEO cloaking that Google penalizes (different content for crawlers vs users) is unrelated to redirect-based affiliate cloaking.
What's the difference between link cloaking and a URL shortener?
A shortener creates a short link on the shortener's domain (e.g., bit.ly/3xYqZ). Cloaking creates a branded URL on your domain (e.g., yoursite.com/recommends/tool). Cloaking gives you branding, trust, and full control. Most modern link platforms do both.
Can I cloak Amazon affiliate links?
Not in the standard way. Amazon's Operating Agreement prohibits cloaking that hides the destination is Amazon. Use Amazon's amzn.to shortlinks, clear text disclaimers, or a smart-uncloaking feature that displays an Amazon-branded URL on the front end.
Will Facebook or Google block my cloaked links?
Iframe-based cloaking, yes. Branded redirect-based cloaking, generally no, as long as the destination matches the ad creative and the displayed URL belongs to the same domain. Both platforms care about deception, not redirects.
Do I need WordPress to cloak a link?
No. WordPress plugins are one option, but a modern link platform with custom domains and a cloaking toggle works on any stack: Webflow, Framer, Shopify, custom code, or no website at all.
Can I track conversions on a cloaked link?
Yes. Install a tracking pixel on the destination, define the events you care about, and enable event tracking on the cloaked link. The cloaking and the pixel work independently and complement each other.
Should I use a 301 or 302 redirect?
Use 302 for most marketing campaigns. It keeps the redirect dynamic so you can update the destination later without cache issues. Use 301 only when the destination is truly permanent.
What's the difference between redirect-based and iframe-based cloaking?
Redirect-based cloaking sends the user to the destination after a brief redirect. Iframe-based cloaking loads the destination inside an iframe, so the cloaked URL stays in the address bar permanently. Iframe cloaking breaks on sites that block iframe embedding and gets flagged faster by ad platforms.
Do I still need to disclose affiliate links if I cloak them?
Yes. The FTC's disclosure requirement applies to the relationship, not the URL format. Cloaking changes how the link looks; it doesn't change your obligation to be transparent that you earn a commission.
Conclusion
Cloaking a link is a clean URL on a domain you control, paired with the right redirect type and the right SEO attributes. It's standard practice for marketers, affiliates, and agencies who care about trust, attribution, and managing links at scale.
Pick the method that matches the stack you actually work in. WordPress users have decent plugin options. Developers can do it manually.
For everyone else who wants cloaking, custom domains, click analytics, and post-click conversion tracking in one place, a modern link platform is the fastest path. ShortPen's free plan includes cloaking and a custom domain, which is enough to set up your first cloaked link with full analytics in a few minutes.
Ready to make every click count?
Simplify your link management, gain valuable insights, and take control of your online presence. Your journey to better links starts here.
