Teach you how to create GoogleSitemap (detailed tutorial and protocol)

Source: Internet
Author: User
Tags iso 8601
I wrote my own GoogleSiteMap file and provided a detailed tutorial here. I hope it will be helpful to you. After a long time, I wrote my own Google SiteMap file. here I will give you a detailed tutorial and hope to help you.

Role of Google SiteMap and detailed explanation of protocol format

Google SiteMap protocolis a site map agreement promoted by google. This document is based on the robots.txt file protocol and has been upgraded. In the official Google guide, it is pointed out that websites with Google SiteMap files will be more conducive to crawling indexing of Google web crawlers, which will improve the efficiency and accuracy of indexing website content. The file protocol applies a simple xml format and uses a total of six tags. The key tags include the link address, update time, update frequency, and index priority.

The format of the Google SiteMap file is as follows:

   
      
   
    
Http://www.knowsky.com </loc>
    
     
T04: 20-
        
    
     
Always
        
    
     
1.0
      
   
    
      
   
    
Http://www.knowsky.com/300687.html </loc>
    
     
2005-06-02T20: 20: 36Z
        
    
     
Daily
        
    
     
0.8
      
   
  
 XML tag

Changefreq: page content update frequency.

Lastmod: Last modification time of the page

Loc: Permanent link address of the page

Priority: priority over other pages

Url: relative to the parent tag of the first four tags

Urlset: parent label relative to the first five tags

I will explain every tag in the xml file in one sentence:

This line defines the namespace of the xml file, which is equivalentTags have the same effect.

This is an entry to the definition of a specific link. every link you want to display in the SiteMap file must be used And This is required.

Http://www.knowsky.com </loc> Description of the specific link address. Note that some special characters in the link address must be converted to escape characters defined in XML (HTML), as shown in the following table:

Character HTML character encoding after character escape

And (and )&&&

Single quotes '''

Double quotation marks """

Yu No. >>>

Minor signs <

2005-06-03T04: 20: 32-08:00 Is used to specify the last update time of the link, which is very important. Google's robot will first compare the last update time of the last index record before indexing this link. if the time is the same, it will skip the next index. Therefore, if the content of your link changes based on the content of the last Google index, you should update the time so that Google will re-analyze the link content and extract keywords at the next index. The time format specified in ISO 8601 must be used to describe the time format. the formatted time format is as follows: TZD is required here, and TZD is specified as the local time zone mark, which is + as in China.

Year (YYYY (2005)

Year and month: YYYY-MM (2005-06)

YYYY-MM-DD)

YYYY-MM-DDThh: mmTZD (2005-06-04T10: 37 + 08: 00)

YYYY-MM-DDThh: mmTZD (2005-06-04T10: 37: 30 + 08: 00)

Always Use this tag to tell Google the update frequency of this link. for example, the homepage must use always (frequently ), yearly (year) can be used for links that were a long time ago or that are no longer updated ). Here we can describe these words: "always", "hourly", "daily", "weekly", "monthly", "yearly ", I don't need to explain the specific meaning. I can understand the meaning of words.

1.0 Is used to specify the priority ratio of this link to other links, this value is set to between 0.0-1.0

AndAnd, These two are used to close the xml tag, which is different fromAndIs a truth

Note that the xml file must be in UTF-8 encoding format. Whether you manually generate the file or use code to generate the file, we recommend that you check whether the xml file is UTF-8 encoded, the easiest way is to open the xml in Notepad and then choose encoding (or converter) as the UTF-8 when saving it.

Log onto Google and submit your SiteMap file. let Google start crawling and open it.

Click Add a Sitemap + to go to the submit page to submit the Sitemap file. We recommend that you store the file in the root directory of your site. After submitting your Sitemap URL to Google, you can see that the URL already exists in the list. However, this does not take effect yet. after several hours, the Status bar changes to OK, which indicates that it takes effect. if it is not OK, you can view the status indication explanation provided by Google to see why.

The above is the content that teaches you how to create Google Sitemap (detailed production tutorial and protocol explanation). For more information, please follow the PHP Chinese network (www.php1.cn )!

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.