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

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

          WordPress无北京k10赛车下载app插件外部链接自动添加nofollow标签加拿大PC28网站入口

          2025-06-22 11:35:01 42

          在wordpress写文章时,当然目前一些wordpress主题设置有这个nofollow标签功能。有时内容会引用或分享一些外部链接地址,可以直接找一些wordpress插件安装。当然我们也可加拿大PC28网站入口trong>北京k10赛车下载app以通过代码实现无插件添加方法。

          //文章自动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 文件中,有些外部链接是没有加Nofollow标签,在技术层面是有传递出去权重。**北京k10赛车下载app****加拿大PC28网站入口这样所有的外部链接就会自动加上nofollow标签。如果手动每个链接加入是很麻烦,严格要求的话是需要在外部链接全部加上nofollow标签。

          本文地址:http://347to.xny028cc.com/yellow/2025-06-22-07-01-00-0.html
          版权声明

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

          热门标签

          全站热门

          鼠标经过文字显示隐藏图片css样式

          HTML5全民飞机大战网页小游戏源码

          35dir网站分类目录导航源码(经典彩色版)

          WordPress网站外链添加GO跳转提示代码

          WordPress免插件实现文章代码高亮方法

          酷炫无比的无穷隧道3d特效

          35dir网站分类目录源码v2.2(纯净版)

          2024黄色闪电404错误页面代码

          友情链接