修改blog的index,follow属性

星期三, 一月 7, 2009 19:08
类别: 博客动态
5 评论250次浏览

在WordPress 中文论坛上看见有人说用了All in one SEO后百度不收录了,于是去搜索了下,网上的意见也不一,有的能被百度正常收录,有的不能。去看了几位大大的修改说明,其实就是index,follow属性在作怪:百度的爬虫其实很傻的,只要你网站上有一个页面存在noindex属性,那么你所有的页面都不会被收录,最后只留下首页;而google的要好的多,完全按照你的意愿办事,禁止收录的就不收录,收录你想收录的。这就不能怪All in one SEO了。

先介绍下index,follow属性代表的意思:
<meta name=”robots” content=”index,follow”>
<meta name=”robots” content=”noindex,follow”>
<meta name=”robots” content=”index,nofollow”>
<meta name=”robots” content=”noindex,nofollow”>
其中index标签表示搜索引擎可以收录,noindex不收录;follow表示可以根据页内链接继续漫游,nofollow则禁止。

要想百度、google都能正常收录你的日志,只要在All in one SEO插件设置中去掉下面3个选项的勾选:
Use noindex for Categories:
Use noindex for Archives:
Use noindex for Tag Archives:

然后针对 Google 爬虫,在你的模板在 header.php 里<head></head>之间插入加这么一句:

<?php if ( !(is_home()) and !(is_single()) ) { ?><meta name=”Googlebot” content=”noindex,follow” /><?php }?>

意思就是除了首页和文章,其它页面最好不要 index。另外这句话前面最好加个空行。

相关日志

你可以 发表评论, 或者 trackback .

5 评论 to “修改blog的index,follow属性”

  1. 东方不摆 says:

    一月 13th, 2009 at 21:18

    学习一下.

    [回复]

  2. 十年博客 says:

    一月 13th, 2009 at 11:24

    修改好连接了哦。不好意思啊

    [回复]

    猢狲 回复:

    @十年博客: 好叻,blog恢复正常就好。你的链接我也弄在首页了。

    [回复]

  3. QQ游戏下载 says:

    一月 8th, 2009 at 14:55

    WP挺好的,个人认为SEO好的博客有两个:WP、ZBLOG

    [回复]

    猢狲 回复:

    @QQ游戏下载: wp刚开始用,还在等效果。zblog还没用过,不敢说。另外,你的这个评论被Akismet拉入垃圾评论里了,why?

    [回复]

发表评论

:装酷 :羡慕 :真棒 :生气 :晕 :擦汗 :幸福 :奸笑 :大笑 :大哭 :吓一跳 :冷