Wordpressblog robots.txt

Source: Internet
Author: User

Using a wordpressbuilt blog, you can use the robots.txt file to restrict the search engine from capturing some directories and files. There are roughly the following methods.

The simplest open Writing Method

Without any restrictions, the link structure in the WordPress site is reasonable. As a general blog, it is enough to be fully open. Code:

User-Agent :*

Allow all Spider access and allow access to all content. This method is recommended as long as the link design in the template is reasonable and there is no special content to be restricted.

The simplest and most rigorous Writing Method

User-Agent :*
Disallow:/WP -*
# Allow:/WP-content/uploads/
Disallow:/*. php $
Disallow:/*. inc $
Disallow:/*. js $
Disallow:/*. CSS $
Disallow :/? S =

Limit file to capture search results.

Disallow:/WP-* will be restricted together with the attachment directory. If you want the search engine to capture the content in the attachment, remove the # comment in the third line. Not all search engines Support allow.

The most reasonable way to write

I also think that robots.txt is the most reasonable.

User-Agent :*
Disallow :/? S =
Sitemap: http://www.lesishu.cn/sitemap.xml

Allows All search engines to crawl, list directories one by one, and restrict the crawling of search results.

Contains the sitemap. xml address (this Viki has a special description, but the Google administrator tool will prompt 'invalid sitemap reference', the validity is still controversial ).

Other statements of robots.txt

To avoid repeated pages in search engines, WordPress players have created many robots writing methods and listed some common ones as a reference (for permanent links in pseudo-static mode ):


# Restrict the capture of WordPress pages

Disallow:/category/*/page /*

# Restrict the paging of the captured category


# Restrict tag capture page

Disallow: */trackback/

# Restrict the capture of trackback content

Disallow:/category /*

# Restrict crawling of all categories

Finally, we recommend that you use the Google administrator tool to log on and access "tools-> analysis robots.txt" to check the file validity.

Author: Yan sishu
Original article: wordpressboke robots.txt
Copyright. The author and original source must be indicated in the form of a link and this statement must be retained.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.