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

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

          WordPr九游互娱软件下载ess无闲娱游戏插件外部链接自动添加nofollow标签

          2025-06-22 12:15:44 59346

          在wordpress写文章时,

          这样所有的外部链接就会自动加上nofollow标签。可以直接找一些wordpress插件安装。当然我们也可九游互娱软件下载ng>闲娱游戏以通过代码实现无插件添加方法。在技术层面是有传递出去权重。如果手动每个链接加入是很麻烦,当然目前一些wordpress主题设置有这个nofollow标签功能。有时内容<九游互娱软件下载strong>闲娱游戏会引用或分享一些外部链接地址,严格要求的话是需要在外部链接全部加上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://g9l05.xny028cc.com/actual/2.html
          版权声明

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

          热门标签

          全站热门

          个人博客网站选择主机服务器技巧

          搜索引擎搜索关键词的标题与链接如何提取?

          帝国CMS内容链接百度主动推送插件BDPush ProV1.1

          dedecms仿站article

          WordPress后台外观主题编辑器屏蔽&隐藏

          个人网站阿里云IPC备案10天办理完成

          python程序实现域名备案信息查询

          wordpress M1主题(精仿唬嗅网v2.3)/新闻网站模板/cms模板

          友情链接