Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Using php script to cloak links

is it ok to use php script to cloak a link

1:32 pm on Jul 23, 2005 (gmt 0)

New User

10+ Year Member

joined:July 23, 2005
votes: 0


I have done some searches and could not find an answer on this. I have found a simple php script that passes on a link call to the target destination. Then the robots.txt file is setup so that search engines are instructed not to follow links out from this script.

Is this a safe way of preventing PR leakage to those links? Or will it be seen as cloaking and invoke a penalty?

I ask as i have a site where most pages have affiliate links. I do also offer extra information such that i hope my site wouldn't be deemed as an thin affiliate! I believe i noticed a drop in ranking since i put these links in and wanted to reverse this if possible! I give them the business so it's not like it's unethical and i obviously don't get a reciprical link back.

Any advice would be great, cheers.

5:03 pm on July 25, 2005 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 22, 2001
votes: 0

Doing this definitely isn't cloaking. I doubt you are being penalized for this. However, wouldn't a rel="nofollow" attribute on the links be easier?
11:12 pm on Aug 3, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Feb 20, 2002
votes: 0

I have a client who refuses to remove all of his (excessive) outgoing links (He's more concerned with making affiliate $'s than he is in selling his own products. (Yet he constantly whines about _MY_ inability to increase sales for him!)

My main concern is that all of those outgoing links will hurt his PR -- especially if they're low-PR or banned/penalized sites.

(Never mind the fact that he's sending prospective buyers away from his site before he even gets a chance to give his sales pitch! Geez!)

So... to eliminate the first problem ("potential" PR penalties) I cloak-out the outgoing links so S.E. spiders can't see/count them. This particular script is written in PHP,

I do it like this:

// include the cloaking function


<P> Visit our sponsor</P>

if IsSpider() {
print "Lose Weight! Grow Hair!";
print "<A href=\"http://www.fat-n-hairy.com/\">Lose Weight! Grow Hair!</a>";


etc., etc....