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

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

          WordPress无加拿大PC28官网开奖结果查询插件外部链接自动添加nofollow标签

          2025-06-24 02:32:51 85773
          有些外部链接是没有加Nofollow标签,可以直接找一些wordpress插件安装。

          在wordpress写文章时,如果手动每个链接加入是很麻烦,在技术层面是有传递出去权重。trong>加拿大PC28官网开奖结果查询当然目前一些wordpress主题设置有这个nofollow标签功能。有时内容会引用或分享一些外部链接地址,

          当然我们也可以通过代码实现无插件添加方法。加拿大PC28官网开奖结果查询严格要求的话是需要在外部链接全部加上nofollow标签。这样所有的外部链接就会自动加上nofollow标签。

          //文章自动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 文件中,

          本文地址:http://vy6z6.xny028cc.com/compete/5.html
          版权声明

          本文仅代表作者观点,不代表本站立场。
          本文系作者授权发表,未经许可,不得转载。

          热门标签

          全站热门

          酷炫html5 canvas全屏背景动画代码

          AI加持电竞模式!iQOO新款智能手表799元起,运动健康好帮手

          40万m³/d!看上海城投水务泰和污水处理厂的领跑者标杆实践

          华为发布HUAWEI Pura 80系列 王者归位再次引领移动影像未来

          经典90版html坦克大战小游戏代码

          HTML网页植物大战僵尸源码分享

          jquery酷炫的马赛克图片还原动画代码

          圆形滚动404动画页面特效

          友情链接