<code id='F9D8694A00'></code><style id='F9D8694A00'></style>
    • <acronym id='F9D8694A00'></acronym>
      <center id='F9D8694A00'><center id='F9D8694A00'><tfoot id='F9D8694A00'></tfoot></center><abbr id='F9D8694A00'><dir id='F9D8694A00'><tfoot id='F9D8694A00'></tfoot><noframes id='F9D8694A00'>

    • <optgroup id='F9D8694A00'><strike id='F9D8694A00'><sup id='F9D8694A00'></sup></strike><code id='F9D8694A00'></code></optgroup>
        1. <b id='F9D8694A00'><label id='F9D8694A00'><select id='F9D8694A00'><dt id='F9D8694A00'><span id='F9D8694A00'></span></dt></select></label></b><u id='F9D8694A00'></u>
          <i id='F9D8694A00'><strike id='F9D8694A00'><tt id='F9D8694A00'><pre id='F9D8694A00'></pre></tt></strike></i>

          当前位置:首页 > WordPr南宫·NG体育ess无电子爆分插件外部链接自动添加nofollow标签 >

          WordPr南宫·NG体育ess无电子爆分插件外部链接自动添加nofollow标签

          来源 蜂狂蝶乱网
          2025-06-18 00:03:29
          这样所有的外部链接就会自动加上nofollow标签。有些外部链接是没有加Nofollow标签,如果手动每个链接加入是很麻烦,

          有时内容会电子爆分引用或分享一些外部链接地址,南宫·NG体育当然我们也可以通过代码实现无插件添加方法。当然目前一些wordpress主题设置有这个nofollow标签功能。可以直接找一些wordpress插件安装。严格要求的话南宫·NG体育>电子爆分是需要在外部链接全部加上nofollow标签。

          在wordpress写文章时,

          //文章自动nofollowadd_filter( 'the_content', 'tin_seo_wl');function tin_seo_wl( $content ) {    $regexp = "<a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>";    if(preg_match_all("/$regexp/siU", $content, $matches, PREG_SET_ORDER)) {        if( !empty($matches) ) {               $srcUrl = get_option('siteurl');            for ($i=0; $i < count($matches); $i++)            {                   $tag = $matches[$i][0];                $tag2 = $matches[$i][0];                $url = $matches[$i][0];                   $noFollow = '';                $pattern = '/target\s*=\s*"\s*_blank\s*"/';                preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);                if( count($match) < 1 )                    $noFollow .= ' target="_blank" ';                   $pattern = '/rel\s*=\s*"\s*[n|d]ofollow\s*"/';                preg_match($pattern, $tag2, $match, PREG_OFFSET_CAPTURE);                if( count($match) < 1 ) $noFollow .= ' rel="nofollow" '; $pos = strpos($url,$srcUrl); if ($pos === false) { $tag = rtrim ($tag,'>');                    $tag .= $noFollow.'>';                    $content = str_replace($tag2,$tag,$content);                }            }        }    }       $content = str_replace(']]>', ']]>', $content);    return $content;}

          添加到当前主题Funcions.php 文件中,在技术层面是有传递出去权重。