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不利。

Related Posts

5 Responses to “Wordpress的Robots.txt该如何写”


  1. 1tomogen

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

    [回复TA]

  2. 2Jackie Zhang

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

    [回复TA]

  3. 3Gr.Zhang

    喜欢,借鉴,学习

    [回复TA]

  4. 4Reisen

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

    [回复TA]

  5. 5夏日冰茶

    正好要

    [回复TA]

Leave a Reply