记录生活 学习SEO优化 | 他日若遂凌云志 敢笑黄巢不丈夫
>>Home > 学习笔记 > WordPress文章编辑增加nofollow标签超链接

WordPress文章编辑增加nofollow标签超链接

Tags: | | 作者:海天无影

博主们写文章的时候,不可避免的会在文章中加入一些链接,如果是博友或者网站等有利链接,那到没什么。可是有的链接比如说反面教材或者下载地址的链接,这些再让他们分享我们页面上本身就少的可怜的PR,那就实在是有点亏了。所以在一些无效链接上加上 rel="nofollow" 标签是很有必要的,但是如果每次需要增加 nofollow 标签都得手动到 HTML 编辑模式添加,那就有点麻烦了。

所以海天就想到用 WordPress 中默认的超链接,其他几个没用的 class 来过滤替换成增加了 rel="nofollow" 标签的超链接。

这个增加 nofollow 标签的海天早就想到的,但是原来对 wordpress 不熟悉,不知道文章的函数;正好前几天海天去逛万戈兄的地盘的时候,看到他写的一篇过滤替换评论中的文字,于是问了他,得知要过滤文章需要的函数是 the_content 。OK,这下万事具备了,开工。

我们先来看看 WordPress 默认的超链接按钮,其中的 class 项有很多,但是我想大家根本就不用这些东西,再说就算要用那也有那么多呢。我们就废物利用,修改其中一个项替换成增加了 nofollow 的超链接。这里我们选择 class="wp-oembed" 的项。

将以下代码复制到 functions.php 文件中:

add_filter('the_content', 'replace_text', 50);
function replace_text ($text = '')
{
$text = str_replace('<a class="wp-oembed"' , '<a rel="nofollow"', $text);
return $text;
}

WordPress文章编辑增加nofollow标签超链接使用方法

编辑文章时,直接将弹出的超链接面板中的 class 选项选择为 wp-oembed 项,就完成了添加nofollow标签的超链接。如果你想设置为其他项为增加 nofollow,则只需要更改上面代码中的 wp-oembed 即可。

wordpress超链接增加nofollow标签

wordpress超链接,用class替换,增加nofollow标签

反对浪费,守住PR,赶快给无效链接加上 nofollow 吧~

海天的分割线

扩展:
如果你觉得还不够狠,害怕百度不认识 nofollow ,那就用跳转吧,就是例如 “http://blog.haitianhome.com/?go=目标站点”,再加上用 robots.txt 过滤掉“?go=”,那么就万无一失了。不过这招过于狠毒,到底用不用自己看着办吧。

add_filter('the_content', 'add_redirect_comment_link', 5);
function add_redirect_comment_link($text = ''){
$text=str_replace('<a class="wp-oembed"' , '<a rel="nofollow"', $text);
return $text;
}
add_action('init', 'redirect_comment_link');
function redirect_comment_link(){
$redirect = $_GET['go'];
if($redirect){
if(strpos($_SERVER['HTTP_REFERER'],get_option('home')) !== false){
header("Location: $redirect");
exit;
}
else {
header("Location: http://blog.haitianhome.com/");
exit;
}
}
}

日志信息 »

该日志于2010-07-09 09:37由 海天无影 发表在学习笔记分类下, 你可以发表评论。除了可以将这个日志以保留源地址及作者的情况下转载到你的网站或博客,还可以通过RSS 2.0订阅这个日志的所有评论。

56条评论▼点击进行评论


  1. Warning: copy(/home/wwwroot/haitian/blog/avatar/c4668a51a1479f6c344c7b79636c2236.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我不太明白,呵呵


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 看来我的描述水平的确不咋滴……:cry:
      现在增加了图片了,你肯定一看就明白了


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/3c17877c75723fb1b98c41b9d7974fc9.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        加了代码以后 还是没有那个选项


  2. Warning: copy(/home/wwwroot/haitian/blog/avatar/53ac5e73cc4436c21bc5364bb95aac49.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    那好要给链接加那个class 不是一样麻烦吗?


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 是我描述的不够清楚
      现在增加了图片了 你一看就应该明白了
      直接选择class选项即可


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/53ac5e73cc4436c21bc5364bb95aac49.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      哦哦哦 明白了 呵呵~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        哈哈 我说有图片肯定一下就知道了~ :grin:


  3. Warning: copy(/home/wwwroot/haitian/blog/avatar/b5ec900bd2256e2315c0c099a453202e.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    哈哈 博客就是要上图 嘿嘿 比较吸引眼球 而且容易明白 顶博主


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 是啊 我描述又不好
      不上图 都不明白


  4. Warning: copy(/home/wwwroot/haitian/blog/avatar/79a9e817c5e3dfd97ce5bda425a1450f.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我就喜欢海天兄发些此类技术性的文章,我好学习学习……


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      哈哈 好的 那我以后多谢谢
      可是 你是PJ的唉~


  5. Warning: copy(/home/wwwroot/haitian/blog/avatar/8a696fb2b60f79867e39e7803303fc7a.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    什么是无效链接?就是打不开的链接吗?


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 我只是到文章最后 随手搭上去的
      意思应该是叫不利链接吧,比如反面教材或者下载地址的链接
      额 反正就是不想分PR给它的链接,一点都想分的……


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/8a696fb2b60f79867e39e7803303fc7a.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        好,我去把那个中国数据给 nofollow 了。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          对对 就是这个意思 像这种反面教材
          一点PR 一点点 一点点点 都不给·


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/12b9ca311887d0c56ef18c36e8dd5fbd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          你真强大 哈哈


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            哈哈 像那种无良链链接 就是不给~


  6. Warning: copy(/home/wwwroot/haitian/blog/avatar/a16f3fde9699e40248f5681949eadda1.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    学习学习


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      哈哈看到蛋卷的头像就觉得可爱~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        可爱是他的武器。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          哈哈 看的出来 看的出来~


  7. Warning: copy(/home/wwwroot/haitian/blog/avatar/4df8bd64e788b23e8bf5b9992b93eb1f.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    学习了 这个好像已经看过了 呵呵


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      不是吧 在哪看的啊
      这种方法 貌似没吧 我以为我第一个原创的呢


  8. Warning: copy(/home/wwwroot/haitian/blog/avatar/0193c519f53ad3be473deae2c87d4b0c.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我也有个wordpress,不过连伪静态,我都不会弄,现在都还是动态的


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 伪静态 主要不是博客了,wordpress本身已经将规则写好了的
      主要是服务器要求,服务器支持 你的博客就支持了


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/0193c519f53ad3be473deae2c87d4b0c.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        不行,我空间也支持,不过我不会写静态规则,配置不好,总是失败


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          额 你是什么wordpress啊,wordpress里本身不就有个.htaccess文件的吗?里面的规则不都是写的好吗?
          只要你在后台的固定链接设置一下就OK的啊


  9. Warning: copy(/home/wwwroot/haitian/blog/avatar/0dcedda7123567217b5ce259e203a209.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我都不进后台,呵呵


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      你是省事啊 直接离线发表
      不过我这个方法 也适合的哦~


  10. Warning: copy(/home/wwwroot/haitian/blog/avatar/12b9ca311887d0c56ef18c36e8dd5fbd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    :grin: 我来回访咯,不错的博客啊,我个人不喜欢这个标签,呵呵反链没了~


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 只是给一些不良链接
      一点都不想分PR给它的链接 我觉得少她几个也无所谓 呵呵~


  11. Warning: copy(/home/wwwroot/haitian/blog/avatar/bbb99c856872bdf1bd23790198834431.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    给那些不重要的链接加上nofollow


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 说的是 既然有nofollow这么一个强大标签 干嘛不用


  12. Warning: copy(/home/wwwroot/haitian/blog/avatar/c97d5ed7936e8a93bf668d771bc0eb00.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    幸好你上图了 不然我也就看不明白了 现在也才大概的明白


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 看来我的描述能力真的超级的差啊
      以后写这类文章一定要配图……


  13. Warning: copy(/home/wwwroot/haitian/blog/avatar/e805958abb711541cb436989fedea3e2.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我好像都没有管过这个呢


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 大多数是不需要了
      不过有反面教材的链接 还是把她给nofollow掉的好?


  14. Warning: copy(/home/wwwroot/haitian/blog/avatar/b79a713d8b51e74836011c37d664d033.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    回访一下。


  15. Warning: copy(/home/wwwroot/haitian/blog/avatar/b79a713d8b51e74836011c37d664d033.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    你的网站虽然没有pr,但是alxa排名还可以,比我的都靠前。


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 说真的我也不知道为什么 我这个新站其他不高
      但才3个月alxa排名为什么能排到这……


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        八戒那网站 我访问 奇慢无比,很奇怪不知道什么情况


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/b79a713d8b51e74836011c37d664d033.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          每次都慢吗?多仿问几次帮我看一下。


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            你的站是有点慢 特别是内容栏 侧边栏加载好以后 要等个1-3秒
            右边的内容栏目才加载好~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/b79a713d8b51e74836011c37d664d033.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        三个月不算是新站了。也是个小老站了。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          哈哈 我感觉没有PR都是新站~


  16. Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    :shock: 好主意啊~!守住了PR 哈哈


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 是啊
      像我们这么可怜的小站 PR本来就低
      能省一点是一点啊~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        这样PR是保住了 但是PV下去了


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          PV?为什么说PV会下去啊?
          PV只是在网站中浏览的页面啊 这个和加上nofollow有什么关系啊 顶多少一点反链罢了,但是既然是那些垃圾链接,我们也不要他的反链啊
          额 你可别回去 什么链接都加上nofollow啊……那就真没PV了~


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            嘿嘿 太懒了, 开始我还真想都什么都加上


            • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
              回复

              额 还是有选择的加上比较好
              要不然 就真的没人回访你了 哈哈~


            • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
              回复

              嘿嘿 你是没注意看吧
              给那些无效链接加上就可以啦
              你全加 会引起公愤的


  17. Warning: copy(/home/wwwroot/haitian/blog/avatar/148de762aabbd4e9c026654bc1c07872.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我对WP很多功能都还不熟悉啊


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 我也很不熟悉啊 慢慢摸索的~


  18. Warning: copy(/home/wwwroot/haitian/blog/avatar/0f6840987df0326df65aaa142fd9245b.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我看明白了~~


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      哈哈 看明白就好
      幸好我加了图 要不然 说不定又看不懂了呵呵


  19. Warning: copy(/home/wwwroot/haitian/blog/avatar/ec52c029d7e97ea0daaf113a05fd1bb6.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    这个有点难呀,一看那些代码头就大了!


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 不难啊 直接把那段代码加入functions.php就可以啦~


  20. Warning: copy(/home/wwwroot/haitian/blog/avatar/d3ff68653c42f043ca2b74a7da580314.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    为什么都加Nofollow呢?Spam也不是那样夸张嘛!


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 注意哦
      不是给评论加nofollow哦,是在你写文章中给你不想要的链接,比如反面教材啊什么的 反正就是给文章中不想分PR的链接加nofollow的


  21. Warning: copy(/home/wwwroot/haitian/blog/avatar/20f9d04987352c3fdcd2ffda4dec7cbc.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    嘿!学习了。。。。。


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 互相学习~
      博主的摄影技术 我很是佩服啊~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/20f9d04987352c3fdcd2ffda4dec7cbc.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        我内绝对是瞎拍。。拍照。。跟摄影咱沾不上边 。。。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          额 我感觉很漂亮的说
          呵呵 我也想要能拍出那样好的照片
          等过段时间 有机会买单反了 找你们学习去啊 哈哈


  22. Warning: copy(/home/wwwroot/haitian/blog/avatar/ae1d9cb02574d579039efc62a447f2f3.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    你这个好麻烦啊,还不如直接添加rel=”nofollow”算了,最好是直接修改添加链接面板,加上nofollow复选框


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      哦 你说的那个在编辑器上直接添加个按钮
      可是 要知道如果要在编辑上添加按钮 那就要在wordpress的核心文件改动了,以后升级就没了 很是麻烦
      那有这个直接在主题文件修改,然后用的时候 也不过就比复选框多一个点击下拉框的步骤,嘿嘿 还是这个方便点~


  23. Warning: copy(/home/wwwroot/haitian/blog/avatar/e657612476777faf50d5f28627975291.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    海天也快变成程序员了。


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 我离程序员 还早呢
      只是拿过来改改 呵呵


  24. Warning: copy(/home/wwwroot/haitian/blog/avatar/0c9157a4f48ba4cc94ada5e7016bcf72.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    貌似比较麻烦,还是jquery方便,依据代码就搞定了。
    $(”a”).attr({rel : “nofollow”});
    这样的话,页面中所有 A 标签就都加上了 nofollow ,如果你只想在评论区显示的话,就把选择器改改就可以了。
    比如:$(”.comment_list .fn”).attr({rel : “nofollow”});


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 我不是说的吗
      只是给那些无效链接加上nofollow啊,你这个什么链接都加上了,太狠毒了 哈哈~
      那些博友啊 或者好的站 还是要有分享精神给他们完整的链接,而那些垃圾连击链接就一点也不给
      我的这个就是 可以方便的选择加或者不加~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/0c9157a4f48ba4cc94ada5e7016bcf72.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        我是评论区、侧栏最新回复全部通杀。
        nofollow本身也没什么坏处,只不过是不让搜索引擎在本站继续追下去了。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          嘿嘿 就是要的这个目的 就像上面光光说的 他写的一篇讲了他原来的垃圾主机商 不可能在文章里再分PR的 所以就要选择性的 在文章里 想加就加~


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/0c9157a4f48ba4cc94ada5e7016bcf72.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            我的做法貌似一个成语可以概括:宁可错杀一千绝不放过一个。
            不过我日志内容中的超链接都没有加的,因为都是我自己分享的网站,所以基本不存在有什么问题。


            • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
              回复

              你的的确是那样 哈哈
              我的也很少加,但是放上去 有用的时候 省的在用的时候 再改代码了


  25. Warning: copy(/home/wwwroot/haitian/blog/avatar/b041fec6d9b41851a84ef29a4827c1d7.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    垃圾评论我一般都在关注,文章的话,我都是先在记事本里面编辑,在粘贴到html编辑器里面的,一般的链接我都是手动加的(当然没有信任度的网站我是不会加这个的,呵呵),不过相信有的朋友会用到这个。


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      你笔记本过滤下也好 说不定又的复制一些文章参考 能过滤不少东西
      呵呵 给有用的朋友吧~


  26. Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    热烈祝贺 海天 这篇文章 关键词 谷歌排第二名


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      什么关键词啊?
      不过貌似这篇文章的点击量不给力啊~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/69ed49aa286d6681161b1d7fe62355fd.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        wordpress nofollow 代码


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          呵呵 是哦 我还没注意呢
          可惜流量还是不给力啊~


  27. Warning: copy(/home/wwwroot/haitian/blog/avatar/e79b68291d7cca7f06d4a71c11c1607a.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    扩展里说的代码,也是添加到上面说的php文件里吗?那robots.txt要写什么,放在跟目录吗?


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      嗯 是的 也是放在functions.php文字里的
      robots.txt写:Disallow: /?go=
      robots.txt要放在网站的根目录的~


  28. Warning: copy(/home/wwwroot/haitian/blog/avatar/e79b68291d7cca7f06d4a71c11c1607a.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    那这样的话,友链会不会也改变了?


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      友链?不会不会
      你只是替换了文章中的链接
      顶多只是样式为wp-oembed的链接会加上nofollow
      但是我发现没有链接是默认的class为wp-oembed的


  29. Warning: copy(/home/wwwroot/haitian/blog/avatar/d94967b298c3fcfed3f8e5a6c5181f42.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    呵呵,我用跳转链接 :mrgreen:


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 那你弄的更彻底了


  30. Warning: copy(/home/wwwroot/haitian/blog/avatar/83b9c9fa1d1c368cc07131c8f988e7fe.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    海天一直在使用可视化编辑器么??


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 是啊 大多都是可视化编辑器


  31. Warning: copy(/home/wwwroot/haitian/blog/avatar/c1c2eaa88b1a266e0fcf13f7cbd937e0.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    用了TinyMCE Advanced! :lol:


  32. Warning: copy(/home/wwwroot/haitian/blog/avatar/25e4582785d136ee3eb396252a40ed0e.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    我对可视化编辑很失望,一般文章中的超链接都是直接当成文本显示。呵呵


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      呵呵 我觉得还好吧 弄图片什么的 方便~


  33. Warning: copy(/home/wwwroot/haitian/blog/avatar/5ee019ca61867c871be35c3a1bde99d0.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    你好,请教个问题。wordpress有没有插件可以实现,将正文中的外部链接全部自动nofollow的功能啊?可以修改哪些文件可以实现这个的功能。谢谢,期待回复,谢谢.


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 这个不需要插件的
      将我上面说的代码中的“ class=”wp-oembed”‘ ”去掉就OK了~


      • Warning: copy(/home/wwwroot/haitian/blog/avatar/5ee019ca61867c871be35c3a1bde99d0.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
        回复

        感谢感谢,成功了。哈哈。


        • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
          回复

          呵呵 没事~


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/5ee019ca61867c871be35c3a1bde99d0.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            继教请教,不知你会不会在dedecms中修改这样的功能;修改方法应该类似于这个(http://www.maxin.cn/archives/2009/237.html)页面介绍和你现在这个方法的结合。但我不会PHP,所以完全看不懂代码,再次请求帮忙,感谢感谢,付费修改也可以的。 :razz:


            • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
              回复

              额 我还没完dede呵呵 所以不知道那个代码是否通用
              你试试


          • Warning: copy(/home/wwwroot/haitian/blog/avatar/5ee019ca61867c871be35c3a1bde99d0.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
            回复

            已加你腾讯微博关注,或者联系我QQ611183108,谢谢。


            • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
              回复

              被过滤了……
              我加你QQ吧


  34. Warning: copy(/home/wwwroot/haitian/blog/avatar/e143d7e70520aa8b3a8acbda28010943.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    functions本来的代码是这样,是替换以下代码,还是在以下代码加上你说的代码呢?还是具体要加在哪个地方呢? 我要给广告联盟的连接加上nofollow

    ”,
    ‘after_widget’ => ”,
    ‘before_title’ => ”,
    ‘after_title’ => ”,
    ));
    ?>


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      加nofollow是将文章中的代码 复制进去~


  35. Warning: copy(/home/wwwroot/haitian/blog/avatar/d290375644f2ef22f620848b0705fdbf.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    add_filter(’the_content’, ‘add_redirect_comment_link’, 5);
    function add_redirect_comment_link($text = ”){
    $text=str_replace(’<a class="wp-oembed"' , '<a rel="nofollow"', $text);
    return $text;
    }
    add_action('init', 'redirect_comment_link');
    function redirect_comment_link(){
    $redirect = $_GET['go'];
    if($redirect){
    if(strpos($_SERVER['HTTP_REFERER'],get_option('home')) !== false){
    header("Location: $redirect");
    exit;
    }
    else {
    header("Location: http://blog.haitianhome.com/");
    exit;
    }
    }
    }
    跳转地址 也就是要过滤的几个地址 写在哪里呢


    • Warning: copy(/home/wwwroot/haitian/blog/avatar/3d58c5baea42043cdd0f012c22cfd774.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
      回复

      额 什么意思?
      这个是把评论的所有链接都过滤


  36. Warning: copy(/home/wwwroot/haitian/blog/avatar/a10c48483c13ac2e92d0503344a5f1c6.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    博主你好,想请问一下你,把read more等链接加上nofollow应该怎么加呢?谢谢博主你…


  37. Warning: copy(/home/wwwroot/haitian/blog/avatar/36ce1976237e19574d5a1e12ebfda0b7.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq


  38. Warning: copy(/home/wwwroot/haitian/blog/avatar/a462925e3db57a6563a1a48b3a8ddba2.jpg): failed to open stream: Permission denied in /home/wwwroot/haitian/blog/wp-content/themes/prowerV3.1/functions.php on line 169
    回复

    写文章的时候都喜欢加别人的链接吗?

icon_wink.gif icon_neutral.gif icon_mad.gif icon_twisted.gif icon_smile.gif icon_eek.gif icon_sad.gif icon_rolleyes.gif icon_razz.gif icon_redface.gif icon_surprised.gif icon_mrgreen.gif icon_lol.gif icon_idea.gif icon_biggrin.gif icon_evil.gif icon_cry.gif icon_cool.gif icon_arrow.gif icon_confused.gif icon_question.gif icon_exclaim.gif 

« 凸显wordpress管理员身份,让管理员评论与众不同 WordPress短代码添加运行代码框 »