WordPress无pc蛋蛋28官网入口插件外部链接自动添加nofollow标签真人在线投注网
在技术层面是有传递出去权重。当然目前一些wordpress主题设置有这个nofollow标签功能。这样所有的外部链接就会自动加上nofollow标签。当然我们也可以通过代码实现无插件添加方法。有时内容会pc蛋蛋28官网入口引用或分享一些外部链接地址,真人在线投注网如果手动每个链接加入是很麻烦, 在wordpress写文章时,严格要求的话是需要在外部链接全部加上nofollow标签。可以直接找一些wordpress真人在线投注网插件安装。pc蛋蛋28官网入口有些外部链接是没有加Nofollow标签, 添加到当前主题Funcions.php 文件中,//文章自动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;}
-
上一篇
-
下一篇
- 最近发表
- 随机阅读
-
- WordPress多功能新闻积分商城主题LensNews2.2
- B站视频下载软件工具推荐
- 浏览器屏蔽广告插件广告终结者
- dedecms织梦仿站工具软件下载
- HTML+JavaScript创建响应式404页面
- jquery css3图片翻转3D动画切换特效代码
- JavaScript实现页面跳转方法大全
- 天猫精灵:跨设备连接领跑行业,品类覆盖引领消费新潮
- 个人网站本地搭建Apache+PHP+MySQL环境
- 浏览器屏蔽广告插件广告终结者
- 大学生情人节520表白html源代码大全
- 40万m³/d!看上海城投水务泰和污水处理厂的领跑者标杆实践
- 谷歌Nest音箱升级“翻车”:部分用户更新后成砖,AI助手Gemini遭质疑
- Instagram APP是什么软件
- CSS3流体多列布局columns属性
- WordPress响应式/音乐/个人博客杂志Always主题V1.8
- 帝国cms开源程序EmpireCMS
- wordpress仿微博个人博客主题tongleer
- fiddler2抓包工具中文汉化版下载
- CSS颜色color与度量单位em
- 搜索
-
- 友情链接
-