WordPress无赏金女王华体会体育2块5爆65万插件外部链接自动添加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 文件中,严格要求的话是需要在外部链接全部加上nofollow标签。在技术层面是有传递出去权重。有些外部链接是华体会体育没有加Nofollow标签,赏金女王2块5爆65万如果手动每个链接加入是很麻烦,有时内容会引用或分享一些外部链接地址,当然目前一些wordpress主题设置有这个nofollow标签功能。可以直接找一些wordpress插华体会体育件安装。赏金女王2块5爆65万这样所有的外部链接就会自动加上nofollow标签。当然我们也可以通过代码实现无插件添加方法。
在wordpress写文章时,
-
上一篇
-
下一篇
- 最近发表
- 随机阅读
-
- 纸张撕裂404错误页面动画效果
- Centos7 mysql自动重启(定时检测mysql运行状态)命令
- json在线工具箱优化版源码
- js实现手机访问网页自动跳转到手机移动页面
- 卡通海底潜艇404页面动画特效
- 网站域名要不要申请使用SSL证书(https)
- 2024黄色闪电404错误页面代码
- 帝国CMS内容链接百度主动推送插件BDPush ProV1.1
- wordpress网站改版更换域名注意事项
- 申请/注册新域名需要注意哪些细节
- wordpress小程序导航收录/小程序模板主题
- wordpess博客主题css/js链接版本号如何去掉
- 搜索引擎网址提交入口有哪些
- 小米米家折叠偏光太阳镜:轻薄时尚,价格亲民,你值得拥有!
- 个人博客html5雪花飘落代码JS特效下载
- WordPress多功能免费主题Git(乐趣公园)下载
- 个人网站文章撰写建议及规范
- 40万m³/d!看上海城投水务泰和污水处理厂的领跑者标杆实践
- jQuery鼠标点击弹出分享按钮代码
- Centos7 mysql自动重启(定时检测mysql运行状态)命令
- 搜索
-
- 友情链接
-