WordPress无麻将胡了可靠的投注网站推荐PG官方入口插件外部链接自动添加nofollow标签
可以直接找一些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)) { 麻将胡了PG官方入口 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标签。
在wordpress写文章时,在技术层面是有传递出去权重。当然我们也可以通过代码
-
上一篇
-
下一篇
- 最近发表
- 随机阅读
-
- 小米户外摄像头大升级:500万像素3K画质,高清看得见,199元带回家
- wordpress XIU主题(阿里百秀)小清新cms模板V5.6
- WordPress音乐主题Always1.8使用教程
- WordPress多功能免费主题Git(乐趣公园)下载
- 松下杭州新公司:家居科技巨擘揭秘10亿日元投资,智能家居新时代即将来临
- 全站死链接检查工具Xenu下载
- WordPress插件No category base移除分类目录category
- 帝国CMS列表页分页标题设置页码
- html5响应式时间轴页面模板大全
- 圣诞节幽灵404页面代码
- wordpress免费插件Math Captcha简单数学验证码
- CSS3变形效果transform
- HTML5表单元input(二)
- QQ互联申请接入qq登录APPID与APPKey方法
- 帝国CMS内容链接百度主动推送插件BDPush ProV1.1
- HTML5实现人工智能中国象棋网页小游戏
- QQ空间心情说说日志类网站织梦模板(带手机端)
- WordPress多功能免费主题Git(乐趣公园)下载
- jQuery鼠标点击弹出分享按钮代码
- 科沃斯T50 Pro扫拖机器人水箱版,3999元降至2235元,百亿补贴优惠不妥协
- 搜索
-
- 友情链接
-