您现在的位置是:WordPress无庄闲的80%赢法插件外部链接自动添加nofollow标签13分钟秒dong:极速赛车最好的投注方法 >>正文
WordPress无庄闲的80%赢法插件外部链接自动添加nofollow标签13分钟秒dong:极速赛车最好的投注方法
以冰致蝇网86871人已围观
简介在wordpress写文章时,//文章自动nofollowadd_filter( 'the_content', 'tin_seo_wl');function t...
在wordpress写文章时,
//文章自动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 文件中,有时内容会引用或分享一些外部链接地址,在技术层面是有传递出去权重。有些外部链接
Tags:
相关文章
wordpress移除后台外观下的编辑和仪表盘的模块
WordPress无庄闲的80%赢法插件外部链接自动添加nofollow标签13分钟秒dong:极速赛车最好的投注方法wordpress后台外观下的编辑不显示问题,有时候个人wordpress主题禁止用户在后台乱修改,可以通过模板函数functions.php等php文件添加以下代码移除wordpress后台外观下的...
阅读更多
dedecms实现tag标签伪静态方法
WordPress无庄闲的80%赢法插件外部链接自动添加nofollow标签13分钟秒dong:极速赛车最好的投注方法dedecms的tag标签是一个很好管理关键词的功能,通过tag标签可以找到相关的关键词内容。但是dedecms的tag标签系统默认是http://www.bokequ.com/tags.php?/t...
阅读更多
WordPress插件Redirection 301重定向跳转
WordPress无庄闲的80%赢法插件外部链接自动添加nofollow标签13分钟秒dong:极速赛车最好的投注方法WordPress插件Redirection 301重定向跳转插件,Redirection是WordPress比较流行的重定向管理插件。有了它,你可以轻松地管理网页301重定向,跟踪404错误,并通常...
阅读更多