WordPress无有极速赛车投注插件外部链接自动添加nofollow标签极速赛车大数据分析软件
可以直接找一些wordpress插件安装。 在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 文件中,有时内容会引用或分享一些外部链接地址,当然我们也可以通过代码实现无插件添加方法。这样所有的外部链接就会自动加上nofollow标签。
- 最近发表
- 随机阅读
-
- 米家智能鱼缸,超值好价!远程投喂+半年免换水,养鱼新体验
- 米家智能鱼缸,超值好价!远程投喂+半年免换水,养鱼新体验
- WordPress文章历史修订版本与自动草稿保存问题
- 帝国cms7.5登录密码忘记多次登录失败被锁解决办法
- dedecms添加文章时禁止自动提取关键字
- QQ空间心情说说日志类网站织梦模板(带手机端)
- 泰达股份拟出售扬州万运100%股权聚焦生态环保主业
- 纤薄机身扫地新宠:科沃斯T50 PRO,水箱版1613元国补新低,体验升级更轻松
- HTML5全民飞机大战网页小游戏源码
- TON Defies Market Sentiment With a Massive 23% Surge, BTC Slumps Toward $70K (Market Watch)
- UNI Slumps 17% Following SEC Developments, BTC, ETH, DOGE, TON on the Rise (Market Watch)
- wordpress隐藏文章部分内容需要注册登录后可见
- Crypto Markets in Retreat: BTC Losses $70K, WIF Plummets 11% Daily (Market Watch)
- wordpress网站防复制插件CopyRights下载
- 呆错免费开源图床系统源码
- WordPress博客分类目录内容不在首页显示方法
- 纸张撕裂404错误页面动画效果
- 帝国CMS内容链接百度主动推送插件BDPush ProV1.1
- 苹果新款HomePod软件将助老款HomePod系列设备焕新春
- 浏览器网页上的图片如何批量保存下载?
- 搜索
-
- 友情链接
-