What is nofollow?
Nofollow is the attribute value of a tag in the HTML page. It’s used to tell search engines “don’t track links on this page” or “don’t track specific links,” that is, it won’t export weights to this link.
It is important for wordless SEO optimization. So it is necessary to add nofolw to the link address if there is an external link address in the article
Add case
Add rel = “nofollow” and do not export your own website weight
<a href="https://www.wpjc.net/" rel="nofollow" >WPTooTutorial network</a>
usage method
Add the following code to the topic functions.php Documents
//Add to the article linknofollow add_filter('the_content','web589_the_content_nofollow',999); function web589_the_content_nofollow($content){ preg_match_all('/href="(.*?)" rel="external nofollow" /',$content,$matches); if($matches){ foreach($matches[1] as $val){ if( strpos($val,home_url())===false ) $content=str_replace("href="$val"", "href="$val" rel="nofollow" ",$content); } } return $content; }