Small SEO Tools

How to Mark Affiliate Links with rel=sponsored

An affiliate link can keep its destination and label while describing the commercial relationship to search engines. Add sponsored to the link’s rel value, preserve any existing tokens you still need, and check the markup your page actually publishes.

This walkthrough uses fictional seed-tray links. It changes the relationship annotation, not the link target or the visible explanation readers see beside it.

Decide which link has a commercial relationship

Start with your actual arrangement, not a guess based on a URL parameter. In this example, the publisher may earn a commission through the shop link, while the care guide is an ordinary editorial reference.

Link Known relationship in this example Markup decision
View seed tray Affiliate program with potential commission Add sponsored and retain the existing noopener token
Read tray care Unpaid editorial guide Leave this example link without a sponsored annotation

Google’s affiliate-link guidance asks affiliate publishers to qualify those links with rel="sponsored", whether they are created manually or dynamically. Its outbound-link documentation also says nofollow remains acceptable for paid links, with sponsored preferred.

Add sponsored inside the existing rel value

The original fragment has an existing token on the shop link but no commercial annotation:

<!-- product links -->
<a href="https://shop.example/seed-tray/?partner=fern" rel="noopener" target="_blank">View seed tray</a>
<a href="https://example.com/seed-tray-care/">Read tray care</a>

Update the template, component or link setting that creates the first anchor. Keep one rel attribute and add the token with a separating space. The intended pair becomes:

<a href="https://shop.example/seed-tray/?partner=fern" rel="sponsored noopener" target="_blank">View seed tray</a>
<a href="https://example.com/seed-tray-care/">Read tray care</a>

The destination, target and readable label have stayed the same, and the editorial neighbor remains unchanged. MDN describes rel values as unique space-separated keywords. Add the new value to the existing list rather than treating it as a replacement for every other relationship token.

If a reviewed affiliate link already has nofollow noopener, retaining those values while adding the preferred annotation gives:

rel="sponsored nofollow noopener"

Inspect existing values before editing, so repeated runs do not keep adding the same token. A visible affiliate explanation and the HTML relationship annotation are separate parts of the page.

Check the link through your HTML processing step

If your workflow uses the HTML Minifier, verify the relationship after processing. The tool does not detect affiliate arrangements or add the annotation for you.

  1. Paste the original fragment into Paste your HTML.
  2. Keep Remove comments (keep conditional) checked and untick Remove whitespace between tags. Leave quote removal and boolean attribute collapsing off.
  3. Select Minify HTML. The comment disappears, but the shop link still has only noopener. Minification has not qualified it.
  4. Paste the manually updated pair and run the same settings. Check for rel="sponsored noopener", the complete shop URL and the unchanged editorial link.

When we ran the current tool code, the updated pair retained those exact attributes and labels. The example that already had nofollow also retained all three tokens. These checks compare the input and output; they do not test Google’s interpretation or visit the fictional shop.

Inspect the saved link before finishing

After saving your actual page, inspect the anchor in browser developer tools. Confirm that sponsored appears as a token in its rel value and that the intended destination remains in href. Check the final DOM too when a script or component generates the link.

Follow the real link in your own test and confirm that it reaches the intended product or offer. Check another link produced by the same template, including an unpaid reference, so a blanket setting has not marked every link as sponsored.

This annotation is not an access restriction or a guarantee that the destination cannot be discovered elsewhere. Keep ordinary links reachable as well; the separate crawlable navigation guide explains why a relationship value cannot replace a real anchor destination.