How to Cloak Affiliate Links in WooCommerce: A Step-by-Step Guide

Share this content

Copy Link
Share

Join 70,000 elite WordPress users levelling up with our expert tips.

Field can not be empty.
Subscribe Now
preloader
An error occured!

Follow us on:

Affiliate links can be a mess, ugly, long, and instantly suspicious. If you are using WooCommerce and just pasting raw URLs, you are probably scaring off clicks and leaving money on the table. No one wants to click a sketchy link that looks like it leads to a scammy corner of the internet.

And let’s be real: If your links look shady, your brand takes a hit, too. Cloaking affiliate links turn links into clean, branded URLs that people actually trust.

In this post, we will walk you through how to cloak affiliate links in WooCommerce the right way so your site stays clean and you can track them easily and safely.

Let’s dive into the content.

What It Means to Cloak Affiliate Links?

Cloaking affiliate links is the practice of turning long, messy, or suspicious-looking affiliate URLs into clean, branded links that are easier to read, trust, and click. Affiliate links often include tracking information, partner IDs, and other parameters that can make them look untrustworthy.

For example, a raw affiliate link is something like this:

https://website.com/product?id=12345&ref=yourname

When you cloak that same link, it could look like this instead:

https://yourstore.com/go/product-name

Even though both links lead to the same destination, the cloaked version looks cleaner and more professional. It also makes the link easier to share, especially on social media or in emails.

Cloaking is usually done using a redirect through a plugin or manually. When someone clicks on your custom URL, they are automatically taken to the original affiliate link behind the scenes.

Difference Between Link Cloaking and Link Shortening

Link cloaking and link shortening seem similar, but they serve slightly different purposes. 

Link shortening is mainly about making long URLs shorter and easier to share. You can use online tools like Bitly or TinyURL to make a big, messy link and turn it into something like bit.ly/abc123. It will change your permalink to numbers and letters.

Link cloaking, on the other hand, is more about control and branding. It not only shortens the link but also hides the original affiliate URL behind a custom, branded redirect like yourstore.com/recommend/product. This makes the link more trustworthy, helps protect your commissions, and keeps everything consistent with your site branding.

So both make links shorter, but link cloaking adds an extra layer of professionalism, tracking, and security that basic link shortening doesn’t offer. 

Why You Should Cloak Affiliate Links in WooCommerce

When running an online store with WooCommerce or EasyCommerce, it’s a good strategy to partner with other brands or services and promote their products via affiliate links. However, leaving these links exposed in their raw form could have several downsides.

cloak affiliate links benefits

Cloaking affiliate links is a strategy used to mask the raw URLs, making them more user-friendly, professional, and trackable.

Below are the major reasons why cloaking affiliate links in WooCommerce is beneficial:

Builds Trust with Users

Affiliate links often look suspicious to users, especially when they contain long strings of random characters or seem to redirect to domains. For example, a URL like domain.com/ref?12345 can seem spammy to visitors.

Cloaking links lets you create clean, branded URLs like domain.com/recommended-product, which users are more likely to trust. When customers trust the links, they are more inclined to click and follow through on a purchase.

Helps with Search Engine Optimization (SEO)

Cloaking links also helps with search engine optimization (SEO). Raw affiliate links often contain tracking parameters or unnecessary identifiers that can clutter your site. Using cloaked links help you present a cleaner structure for search engines to follow. 

Additionally, some search engines may penalize sites that display long, unprofessional affiliate URLs, so keeping things neat with cloaking may avoid any SEO drawbacks.

Create a Better Brand Image

Cloaking affiliate links enables you to incorporate your own WooCommerce store domain name, which maintains consistent branding across your website. Instead of sending visitors to an external site with a URL that doesn’t match your store, cloaked links allow you to redirect them through your domain.

So, you can create a seamless experience for your users and ensures your brand stays front and center throughout the shopping journey.

Protection Against Link Hijacking

Raw affiliate links can be vulnerable to “link hijacking.” This occurs when someone modifies your affiliate link to steal your commission. For instance, an affiliate link might be shared by someone else and could have their own affiliate code embedded instead of yours. 

Cloaked links help you reduce the chances of this happening and ensures that any sales made via your referral are credited to your account.

Easier Link Management

As your affiliate program grows, managing multiple affiliate links can become a hassle. Cloaking your links with a URL shortener or an affiliate link management plugin lets you easily edit, track, or even update links in bulk without having to go through individual posts or pages.

This level of control saves you significant time and reduces the likelihood of broken links or errors on your site.

More Control Over Redirection

When you cloak an affiliate link, you can also manage the redirects more effectively. For example, you can set up custom redirects, monitor the success of your links, and adjust strategies in real time. 

Some advanced cloaking methods allow you to test different landing pages, track conversions, and implement tracking pixels or retargeting tools to maximize affiliate commissions.

How to Cloak Affiliate Links Using  a WordPress Plugin

Cloaking affiliate links using an WordPress affiliate plugin is much easier the conventional methods. In this part, we will explore how you can easily cloak affiliate links with a WordPress plugin.

Step 1: Install WC Affiliate and Configure Basic Settings

First, you have to install both WC Affiliate and WC Affiliate Pro on your website. Go to your WordPress Dashboard > Plugins > Add New and then search for WC Affiliate.

install and activate affiliate plugin

In the same way, upload the pro version and activate it. After that, go to Setup Wizard.

go to setup wizard for setup

On the setup wizard page, create your new Affiliate Dashboard page, or if you have already created it manually, then set it yourself.

create an affiliate dashboard page

After that, click the Next button to configure your commission settings. Here, you need to set the affiliate commission base, their commission rate, and the cookie expiry from the dropdown.

configure affiliate settings.

After all your setup is done, click the finish button to continue to the next step for cloak affiliate link settings.

Step 2: Set Cloaking Affiliate Links Settings

Now go to site Dashboard > WC Affiliate > Settings > Shortlinks. There, you need to enable shortlinks for affiliates, set the URL base, and set a personal identifier for your affiliate’s shortlink. You can also set the identifier length from those settings.

cloak affiliate links settings for your WooCommerce website

Step 3: Generate Affiliate Links

Now that your setup in complete, you can let your affiliate generate short cloak affiliate links on their own. They need to log in to their Affiliate Dashboard > URL Generator. First, enable the Create Shortlink option and then set your identifier for the link.

After that click on the Generate button.

Settings for generating cloak affiliate links in WooCommerce

After you click the generate button, you will be able to see your desired cloaked affiliate links for WooCommerce.

Final result for cloak links

This plugin also offers many other functionalities like, you can set up multilevel commission for your affiliates, generating banners, etc.

How to Cloak Links Without a Plugin

If you are good at coding and have experience managing domains and hosting, then this part is for you. Here’s our simple guide for cloaking affiliate links without a plugin.

Step 1: Create a New Folder

At first, log in to your hosting server. You can also do this by using a free FTP/SFTP solution like FileZilla. After logging in, go to your main directory folder.

log in dashboard for FileZilla

After that, create a new folder on the server. This folder’s name will be your URL slug, so try this: go, recommend, out, etc.

Step 2: Upload the index.php File

Next, create another file inside the folder you just created. Name this file as index.php and add the following code from Yoast’s GitHub.

Step 3: Add the Links in the Redirects.txt File

Now you need to create a redirects.txt file for cloaking your affiliate links. In this file, you can add your destination URL and its slug. The format is:

link-slug, https://destinationurl.com/?affid=123 

Add each of the affiliate link on its own line, like this:

link-slug,https://destinationurl.com/?affid=123

codexpert,https://codexpert.io?kaid=123

If you want to handle edge cases you should also make sure that the first line is:

default,http://yoursite.com

Step 4: Block Crawlers

To prevent search engines from indexing your cloaked affiliate link, add Disallow: /folder-name/ to your robots.txt file. And if you want to learn how to edit your robots.txt file, check out this Full WordPress robots.txt Guide

Final Words

Cloaking affiliate links in WooCommerce helps boost credibility, improve user experience, and enhance SEO. By turning raw, suspicious links into clean, branded URLs, you protect your commissions and build trust with your audience. If you are using a plugin like WC Affiliate or manual redirection, cloaking increases click-through rates, strengthens brand consistency, and simplifies link management.

It’s more than just shortening URLs, it’s about presenting professional, trustworthy links. Start cloaking your affiliate links today and give your WooCommerce store a polished edge that both customers and search engines will love.

Frequently Asked Questions (FAQs)

Q. How do I create an affiliate link on WooCommerce?

Q. Do Affiliate links hurt SEO?

Q. Should I cloak Amazon affiliate links?

Q. How do I add affiliate disclosure to WordPress?

Subscribe to Our Newsletter

Get the latest WordPress tutorials, trends, and resources right in your inbox. No Spamming, Unsubscribe Anytime.

Please fill out the empty field.

preloader

Thank you for subscribing to our newsletter!

Mustakim Ahmed

A seasoned Business Developer & Support Engineer who is deeply passionate about resolving WordPress-related issues and contributing to WordPress. His expertise lies in enhancing user experiences and driving success within the WordPress ecosystem.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top