It turns out that many of the articles on the site are excerpts from external articles. Many links in the articles have either expired over time, or they are some test URLs, such as: http://localhost/, etc., with many links. If not, it will form a lot of dead links in the site, which is very detrimental to SEO optimization. Then you need to filter the content within the site and add the rel="nofollow" attribute to links that are not internal links.
I found wordpress’s function for filtering external links on the Internet, just change it and you can use it
//Add nofllow to external links $content content $domain current website domain name function content_nofollow($content,$domain){ preg_match_all('/href="(.*?)"/',$content,$matches); if($matches){ foreach($matches[1] as $val){ if( strpos($val,$domain)===false ) $content=str_replace('href="'.$val.'"', 'href="'.$val.'" rel="external nofollow" ',$content); } } preg_match_all('/src="(.*?)"/',$content,$matches); if($matches){ foreach($matches[1] as $val){ if( strpos($val,$domain)===false ) $content=str_replace('src="'.$val.'"', 'src="'.$val.'" rel="external nofollow" ',$content); } } return $content; } It is easy to call when calling. The following is a calling demonstration. $a['content'] = content_nofollow($a['content'],$domain); //Add the nofllow attribute to the links in the article content Notice! The filtered domain name needs to be without "/", such as http://www.ledaokj.com This allows for good filtering. Original link: Add filtering for external links to site content