It has been on my remember the milk to do list for a couple months now to convert any mentions of DreamHost occurring on my WordPress blog into a affiliate link… they actually offer $97 for every customer you send them. I was figuring it would take no more than an hour to search and replace all of the different occurrences of the phrase “DreamHost” but was pretty sure I could find a way to do it faster using some sort of plug-in. I have no idea how much money this small time investment might make me over the next 10 years but I find it interesting that there is this potentially large opportunity to make money that I have not yet taken advantage of. Anyway I found a quick way to do it on this website … the writer actually provides a premium plug-in, a free plug-in, and then a manual way to drop it into your functions.php file. The problem with putting it into the functions.php file is that in the future if you change your WordPress theme you’ll also have to transition this code into the other functions.php file.
Here is a screenshot of the premium WordPress plug-in that handles the smart linking for search engine optimization:
Here is the code you need to add to your functions.php file located in your current theme folder. Note that some teens do not have a functions.php file so you need to create the file. Note that the keyword text is case-sensitive.
function replace_text_wps($text){ $replace = array( // 'WORD TO REPLACE' => 'REPLACE WORD WITH THIS- case sensitive!' 'dreamhost' => 'Dreamhost', 'Dreamhost' => 'Dreamhost', 'DreamHost' => 'Dreamhost', 'dreamHost' => 'Dreamhost', 'excerpt' => 'excerpt', 'function' => 'function' ); $text = str_replace(array_keys($replace), $replace, $text); return $text; } add_filter('the_content', 'replace_text_wps'); add_filter('the_excerpt', 'replace_text_wps'); Nov 2013 Update: Just downloaded the SEO Smart Links + plugin again ( somehow it got uninstalled )... with the new version it seems you don't need to add that code to the functions.php file.