Wordpress的Robots.txt该如何写

最近不断的换Wordpress主题,主要都是在进行SEO。另外还很重要的一点就是代码必须符合W3C规范。今天终于找到了个样式还不错,也完全符合W3C规范的主题,不过是个小日本人制作的。第一次不客气,直接把版权给它去掉了。

网站的Robots还一直没有写,今天特地查下资料,针对Wordpress如何写Robots文件。

最常用的写法:

User-agent: *
Disallow: /wp-
Disallow: /feed/
Disallow: /trackback/
Disallow: /comments/feed/
Disallow: /page/
Disallow: /comments/

这个也是:

User-agent: *
Disallow: /blog/wp-admin/
Disallow: /wp-login.php
Disallow: /blog/page/
Disallow: /blog/wp-content/
Disallow: /blog/feed/

还有这个:

User-agent: Googlebot
# Disallow all directories and files within
Disallow: /cgi-bin/
Disallow: /wp-admin/
Disallow: /wp-includes/
# Disallow all files ending with these extensions
Disallow: /*.php$
Disallow: /*.js$
Disallow: /*.inc$
Disallow: /*.css$
# Disallow parsing individual post feeds, categories and trackbacks..
Disallow: */trackback/
Disallow: */feed/
Disallow: /category/*

不过需要注意,根据自己定义的链接更改内容。我就用第一份最保守的写法吧。综合了一份,感觉应该不错。robots.txt,注意Robots文件必须小写,还必须放在一级目录下。再发誓次:这个小日本的主题奥运会之前不再换了!不然又是几天一换,反而对SEO不利。

标签:, ,

“Wordpress的Robots.txt该如何写” 共有5 条回复


  1. 1tomogen

    呵呵,日本人做的东西是比我们好。而且还考虑到了中文化。
    用了就用了,版权去了就去了。也时为了美观我也会去掉。
    不过你用了他的东西还藐视对方一样,那样不如自己写个吧。

  2. 2Jackie Zhang

    @tomogen
    呵呵,我到想自己写个,不过技术有限啊。如果他不是个日本人,或者日本认错了,我就绝对不会藐视他了。

  3. 3Gr.Zhang

    喜欢,借鉴,学习

  4. 4Reisen

    It is right on that getting credible documentation on this subject can be troublesome.

  5. 5夏日冰茶

    正好要

发表评论

:em1 :em2 :em3 :em4 :em5 :em6 :em7 :em8 :em9 :em10 :em11 :em12 :em13 :em14 :em15 :em16 :em17 :em18 :em19 :em20 :em21 :em22

XHTML: 您可以在评论中使用这些代码 <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> :