Hello! Here is the cod snip from web, wordpress. add_filter('the_content', 'auto_nofollow'); function auto_nofollow($content) { //return stripslashes(wp_rel_nofollow($content)); return preg_replace_callback('/<a>]+/', 'auto_nofollow_callback', $content); } function auto_nofollow_callback($matches) { $link = $matches[0]; $site_link = get_bloginfo('url'); if (strpos($link, 'rel') === false) { $link = preg_replace("%(href=S(?!$site_link))%i", 'rel="nofollow" $1', $link); } elseif (preg_match("%href=S(?!$site_link)%i", $link)) { $link = preg_replace('/rel=S(?!nofollow)S*/i', 'rel="nofollow"', $link); } return $link; } PHP: I want to ask is it possible to put all internal links 'rel=dofollow' Also does it make sense 'rel=dofollow' ? Thank you!
The code ( should ) match only urls which does not contain your blog url in href code, so only external links. If internal links are nofollow as well the following part might be wrong, not to sure, think its deprecated or your wp is setting for home url and blog url are different. Either of those should explain the behavour Can you test to replace $site_link = get_bloginfo('url'); Code (markup): with this $site_link = get_bloginfo('wpurl'); Code (markup):
There is no point in making links dofollow. Dofollow is just a term to describe links that don't have the nofollow attribute.