I'm sorry if i've posted in the wrong section. My query is how can we hide the links(affiliate links) in our site. The cloaking software is not reliable. So any programming will do the cloaking service.

Dani AI

Generated

Asking how to “hide” affiliate links is a common question, but it’s important to separate two goals: (a) keep affiliate URLs tidy and manageable, and (b) try to hide or deceive search engines or users. and already flagged the risks of deceptive behavior; serving different content to crawlers or obscuring what a link does can lead to search penalties, broken tracking, or even affiliate-account suspension. A safer approach is to make links look clean while remaining transparent and compliant.

A practical, search-engine-friendly workflow:

  • Create short, on-domain vanity URLs (so links look consistent with the site).
  • Route those vanity URLs through a small server-side click-handler that logs the click (token, timestamp, referrer) and then performs a standard HTTP redirect to the real affiliate URL.
  • Mark the click-handler endpoint so it won’t be indexed (meta robots noindex or X-Robots-Tag), and keep clear affiliate disclosure on pages that contain paid links.
  • Respect the affiliate program’s tracking parameters — do not alter or strip them in ways the program prohibits.

Example pattern (keeps behavior explicit and auditable):

# .htaccess (example)
RewriteEngine On
RewriteRule ^r/([A-Za-z0-9_-]+)$ /click.php?token=$1 [L,QSA]

# click.php (outline)
<?php
$token = $_GET['token'] ?? '';
// map token -> affiliate URL from a DB
// record click (IP, UA, token, timestamp)
// then redirect
header('Location: ' . $affiliateUrl, true, 302);
exit;
?>

Notes and cautions: avoid frame/proxy tricks that mask destination pages; test that the affiliate network records clicks correctly; consult affiliate TOS and applicable disclosure laws before deploying. This balances ’s warning about risky techniques and ’s advice to focus on legitimate, value-driven content rather than tricks.

Recommended Answers

All 2 Replies

One thing you could do is use a robots.txt file to prevent search engines from crawling pages with outbound links. Then no PR is lost because the search engines aren't even crawling those pages. But keep in mind that any internal links on those pages won't be counted either. This is common to do with a directory.

Another thing you may want to try is to use a script that redirects users to external sites (example: http://www.domain.com/outboundlinks.php?id=linkidhere) and then put outboundlinks.php into your robot.txt file. Then the search engines won't follow the links because they can't access the script that does the redirect. Why would you want to do this? Becasue search engines do follow redirect scripts so the PR is being sent out of your site anyway.

The latest technique available is to put 'rel="nofollow"' in your anchor tag. Google, and others I do believe, will not follow these links and in Google's case not pass along PR.

FYI, cloaking any content will get you banned.

... cloaking ...

It seems to be about tricking everybody and everything. First trick the search engines then trick the visitor. Seems to me like you have a bad case indeed, something similar to the ever contagious Adsense flu.

I recommend that you take two aspirins, get a good night sleep then concentrate on creating something meaningful for the Internet.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.