homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Automatic Text to Hyperlink

 8:52 am on Mar 8, 2009 (gmt 0)

Hi All,

Can anybody please recommend any scripts that can be setup to automatically replace text with a URL's.

A lot of sites seem to have this feature, I cant find any scripts that will enable me to do this.

Thank you



 1:14 pm on Mar 8, 2009 (gmt 0)

Do you have any coding background? It is fairly straight forward if you have the ability to write some code yourself.

Are you talking about replacing a text url with a real link? Or are you talking about replacing actual keywords with links?

I've recently implemented both on my site(s), but it was all custom coding done in Perl.


 8:16 pm on Mar 8, 2009 (gmt 0)

I do have a programming background, but not too recent and not with Perl or Java.

Im talking about replacing keywords with Links/hyperlinks.

I was hoping that there is a pre-build script I can include and maybe update a text file with keywords and url's.


 9:02 pm on Mar 8, 2009 (gmt 0)

Three questions...

1) Why? I've seen this feature many times and it is just plain annoying.
2) What technology are you using? (static html, php, etc.)
3) Are you thinking of using javascript on the client-side? If yes, visiting the javascript forum would be advisable.



 9:22 pm on Mar 8, 2009 (gmt 0)

How else would I do internal linking of pages, If I do it manually it will take a very very long time.

From what I been reading internal linking is very important to Search Engines, what are the alternatives?

My pages are all php


 4:02 am on Mar 9, 2009 (gmt 0)

I think if it is done tastefully it can be extremely useful. Wikipedia is built off this concept.

We ended up building our own custom script for this that was heavily taylored to our content. My guess is you will need something very custom as well if you want it to work properly and not just link to unrelated stuff.

A other benefit is to thwart scapers. Embedding absolute links in your content makes those links portable when someone copy and pastes your page. Easy enough for bots to filter, but it is an extra step for them.

Lastly, it can help search bots find more of your content and make your page more relevant by having these related pages linked to your content.

You can't argue with the success wikipedia has in search results. ;-)


 11:22 am on Mar 9, 2009 (gmt 0)

My pages are all php

Is the content in a database? if it is, it's fairly easy.

$pairs = array(
'/keyword/' => '<a href="http://www.example.com/">keyword</a>',
'/otherword/' => '<a href="http://www.example.com/">otherword</a>',
while ($newArray = mysql_fetch_array($result)){
$text = preg_replace(array_keys($pairs), array_values($pairs), $newArray['text'], 1);

The 1 at the end is so it only changes the first mention of that word.



 8:04 am on Mar 10, 2009 (gmt 0)

Hi, Unfortunately its not in a database, that is why I wanted to call some script that would look for my keywords and replace them with links.


 9:18 pm on Mar 14, 2009 (gmt 0)

Anybody please - I really don't want to cross link all of my pages manually.


 4:34 am on Mar 15, 2009 (gmt 0)

Can anyone suggest a Keyword to link script [webmasterworld.com]


 10:45 am on Mar 16, 2009 (gmt 0)

This topic has been discussed a lot recently around the net in wordpress circles. The plugin aLinks used to do this for most blogs but the author closed the site a year ago and the plugin stopped working.

Of all the options a plugin called cross-linker is confirmed to work on the latest version of wordpress (2.7.1) and it does it's thing well.

You said you're running a php site but not using a database so I assume you're not running wordpress. That being said the plugin is open source and the core functions can be extracted from the code.

I'm mentioning the plugin because this subject affects wordpress users too.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved