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 :*
Disallow:
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:/WP-Admin
Disallow:/WP-content/plugins
Disallow:/WP-content/themes
Disallow:/WP-includes
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 ):
Disallow:/page/
# Restrict the capture of WordPress pages
Disallow:/category/*/page /*
# Restrict the paging of the captured category
Disallow:/Tag/
# 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.