Automatically generating internal links within content based on keywords..

Status
Not open for further replies.

dreamache

New member
Jun 26, 2006
4,393
130
0
I want to start writing articles on a specific site (custom site, no wordpress or anything else), and I know about the importance of internal links...

But I want something automatic, manually having to create links for each article pointing to other articles based on keywords is a pain in the ass.

So I'm wondering if there's a script out there that might do this already, and if not, how you might go about doing it in php/mysql.

I assume it might be something as simple as just specifying the keywords for each article that you want the article to be linked from... Then on the article display page, pull the article content from the database, fetch all of the articles from the database (the keywords row), loop through each of them doing a str_replace each time a keyword is found and adding a <a href="article">kw</a> ?

That doesn't sound like the best solution though since it would have to do that for every visitor...

Thanks.
 


I was going to say 'Lazy Fucker', but then I noticed you intend to WRITE articles, rather than generate them automatically. So another soubriquet springs to mind.
 
  • Like
Reactions: omgyams
Had to Google that one

A sobriquet is a nickname or a fancy name, usually a familiar name given by others as distinct from a pseudonym assumed as a disguise, but a nickname which is familiar enough such that it can be used in place of a real name without the need of explanation. ...
 
I assume it might be something as simple as just specifying the keywords for each article that you want the article to be linked from... Then on the article display page, pull the article content from the database, fetch all of the articles from the database (the keywords row), loop through each of them doing a str_replace each time a keyword is found and adding a <a href="article">kw</a> ?

That doesn't sound like the best solution though since it would have to do that for every visitor...

Thanks.

Maybe better then to just have the links in an included file that gets updated every time you add/remove/edit an article.
 
Status
Not open for further replies.