Alex Poole

Pragmatic PHP, MySQL, Marketing & Technology

Alex Poole header image 2

Spin Backlink Link Text with PHP

January 26th, 2010 by alex

Quick one: if you’re placing backlinks on sites for SEO purposes and you’re at all worried about over-optimisation, this technique may be useful to you:


<a href="http://www.isvirtual.co.uk"><?php echo rand(0,1) ? "Website design" : "Web Site Design"; ?></a> and <a href="http://www.isvirtual.co.uk/seo-cambridge.php"><?php echo rand(0,1) ? "SEO Cambridge" : "Cambridge SEO"; ?></a> by <a href="http://www.isvirtual.co.uk"><?php echo rand(0,1) ? "ISVirtual" : "IS Virtual"; ?> </a>

You get the idea. Of course you could spin more than 2 varations of each.
You’ll want to “lock” the randomisation too.  Before the first call to rand() use:

<?php mt_srand(crc32($_SERVER['REQUEST_URI'])); ?>

If you’re very cautious or backlinking a big site, you might want to use “vanilla” variations like “click here” too ;)

Hope that’s useful to you.

Tags:   No Comments

Leave a Comment

0 responses so far ↓

There are no comments yet...Kick things off by filling out the form below.