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

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

          WordPre巅峰国际pg下载入口官网ss无决胜巅峰国际服官网下载插件外部链接自动添加nofollow标签

          2025-06-20 05:43:30 33351

          在wordpress写文章时,有些外部链接是没有加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 文件中,可以直接找一些wordpress插件安装。如果手动每个链接加入是很麻烦,巅峰国际pg下载入口官网>决胜巅峰国际服官网下载严格要求的话是需要在外部链接全部加上nofollow标签。当然我们也可以通过代码实现无插件添加方法。在技术层面是有传递出去权重。这样所有的外决胜巅峰国际服官网下载巅峰国际pg下载入口官网strong>部链接就会自动加上nofollow标签。有时内容会引用或分享一些外部链接地址,当然目前一些wordpress主题设置有这个nofollow标签功能。

          本文地址:http://hacrs.xny028cc.com/opposite/2025-06-20-01-11-25-8.html
          版权声明

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

          热门标签

          全站热门

          Bitcoin (BTC) Challenges $68K, Dogecoin (DOGE) Soars 5% Daily (Weekend Watch)

          wordpress提示function.call

          wordpress插件Bing URL Submissions网址自动提交到必应

          JavaScript对象中的方法/如sort(参数)方法

          谷歌Nest音箱升级“翻车”:部分用户更新后成砖,AI助手Gemini遭质疑

          html5网页底部mp3音乐播放器代码

          php7.4帝国CMS报错Deprecated: Function get

          dedecms织梦网站模板源码图文安装教程

          友情链接