Sitemaps


The Sitemaps protocol allows a webmaster to inform search engines about URLs on a website that are available for crawling. A Sitemap is an XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes, and how important it is in relation to other URLs of the site. This allows search engines to crawl the site more efficiently and to find URLs that may be isolated from the rest of the site's content. The Sitemaps protocol is a URL inclusion protocol and complements robots.txt, a URL exclusion protocol.

History

Google first introduced in June 2005 so web developers could publish lists of links from across their sites. Google, Yahoo! and Microsoft announced in November 2006. The schema version was changed to "Sitemap 0.90", but no other changes were made.
In April 2007, for Sitemaps. Also, Google, Yahoo, MSN announced auto-discovery for sitemaps through robots.txt. In May 2007, the state governments of announced they would use Sitemaps on their web sites.
The Sitemaps protocol is based on ideas from "Crawler-friendly Web Servers," with improvements including auto-discovery through robots.txt and the ability to specify the priority and change frequency of pages.

Purpose

Sitemaps are particularly beneficial on websites where:
The Sitemap Protocol format consists of XML tags. The file itself must be UTF-8 encoded. Sitemaps can also be just a plain text list of URLs. They can also be compressed in.gz format.
A sample Sitemap that contains just one URL and uses all optional tags is shown below.


xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">

http://example.com/
2006-11-18
daily
0.8



The Sitemap XML protocol is also extended to provide a way of listing multiple Sitemaps in a 'Sitemap index' file. The maximum Sitemap size of 50 MiB or 50,000 URLs means this is necessary for large sites.
An example of Sitemap index referencing one separate sitemap follows.




http://www.example.com/sitemap1.xml.gz
2014-10-01T18:23:17+00:00


Element definitions

The definitions for the elements are shown below:
ElementRequired?Description
The document-level element for the Sitemap. The rest of the document after the '' element must be contained in this.
Parent element for each entry.
The document-level element for the Sitemap index. The rest of the document after the '' element must be contained in this.
Parent element for each entry in the index.
Provides the full URL of the page or sitemap, including the protocol and a trailing slash, if required by the site's hosting server. This value must be shorter than 2,048 characters. Note that ampersands in the URL need to be escaped as &.
The date that the file was last modified, in ISO 8601 format. This can display the full date and time or, if desired, may simply be the date in the format YYYY-MM-DD.
How frequently the page may change:
  • always
  • hourly
  • daily
  • weekly
  • monthly
  • yearly
  • never
"Always" is used to denote documents that change each time that they are accessed. "Never" is used to denote archived URLs.
This is used only as a guide for crawlers, and is not used to determine how frequently pages are indexed.
Does not apply to elements.
The priority of that URL relative to other URLs on the site. This allows webmasters to suggest to crawlers which pages are considered more important.
The valid range is from 0.0 to 1.0, with 1.0 being the most important. The default value is 0.5.
Rating all pages on a site with a high priority does not affect search listings, as it is only used to suggest to the crawlers how important pages of the site are to one another.
Does not apply to elements.

Support for the elements that are not required can vary from one search engine to another.

Other formats

Text file

The Sitemaps protocol allows the Sitemap to be a simple list of URLs in a text file. The file specifications of XML Sitemaps apply to text Sitemaps as well; the file must be UTF-8 encoded, and cannot be more than 10 MB large or contain more than 50,000 URLs, but can be compressed as a gzip file.

Syndication feed

A syndication feed is a permitted method of submitting URLs to crawlers; this is advised mainly for sites that already have syndication feeds. One stated drawback is this method might only provide crawlers with more recently created URLs, but other URLs can still be discovered during normal crawling.
It can be beneficial to have a syndication feed as a delta update to supplement a complete sitemap.

Search engine submission

If Sitemaps are submitted directly to a search engine, it will return status information and any processing errors. The details involved with submission will vary with the different search engines. The location of the sitemap can also be included in the robots.txt file by adding the following line:
The <sitemap_location> should be the complete URL to the sitemap, such as:
This directive is independent of the user-agent line, so it doesn't matter where it is placed in the file. If the website has several sitemaps, multiple "Sitemap:" records may be included in robots.txt, or the URL can simply point to the main sitemap index file.
The following table lists the sitemap submission URLs for several major search engines:
Search engineSubmission URLHelp pageMarket
Baiduhttps://zhanzhang.baidu.com/dashboard/indexChina, Singapore
Bing https://www.bing.com/webmaster/ping.aspx?siteMap=Global
Googlehttps://www.google.com/webmasters/tools/ping?sitemap=Global
Yandexhttps://webmaster.yandex.com/site/map.xmlRussia, Ukraine, Belarus, Kazakhstan, Turkey

Sitemap URLs submitted using the sitemap submission URLs need to be URL-encoded, for example: replacing : with %3A, / with %2F.

Limitations for search engine indexing

Sitemaps supplement and do not replace the existing crawl-based mechanisms that search engines already use to discover URLs. Using this protocol does not guarantee that web pages will be included in search indexes, nor does it influence the way that pages are ranked in search results. Specific examples are provided below.
Sitemap files have a limit of 50,000 URLs and 50MB per sitemap. Sitemaps can be compressed using gzip, reducing bandwidth consumption. Multiple sitemap files are supported, with a Sitemap index file serving as an entry point. Sitemap index files may not list more than 50,000 Sitemaps and must be no larger than 50MiB and can be compressed. You can have more than one Sitemap index file.
As with all XML files, any data values must use entity escape codes for the characters ampersand, single quote, double quote, less than, and greater than.
Best practice for optimising a sitemap index for search engine crawlability is to ensure the index refers only to sitemaps as opposed to other sitemap indexes. Nesting a sitemap index within a sitemap index is invalid according to Google.

Additional Sitemap Types

A number of additional XML sitemap types outside of the scope of the Sitemaps protocol are supported by Google to allow webmasters to provide additional data on the content of their websites. Video and image sitemaps are intended to improve the capability of websites to rank in image and video searches.

Video Sitemaps

Video sitemaps indicate data related to embedding and autoplaying, preferred thumbnails to show in search results, publication date, video duration, and other metadata. Video sitemaps are also used to allow search engines to index videos that are embedded on a website, but that are hosted externally, such as on Vimeo or YouTube.

Image Sitemaps

Image sitemaps are used to indicate image metadata, such as licensing information, geographic location, and an image's caption.

Google News Sitemaps

Google supports a Google News sitemap type for facilitating quick indexing of time-sensitive news subjects.

Multilingual and multinational Sitemaps

In December 2011, Google announced the annotations for sites that want to target users in many languages and, optionally, countries. A few months later Google announced, on their official blog, that they are adding support for specifying the rel="alternate" and hreflang annotations in Sitemaps. Instead of the HTML link elements the Sitemaps option offered many advantages which included a smaller page size and easier deployment for some websites.
One example of the Multilingual Sitemap would be as follows:
If for example we have a site that targets English language users through http://www.example.com/en and Greek language users through http://www.example.com/gr, up until then the only option was to add the hreflang annotation either in the HTTP header or as HTML elements on both URLs like this




But now, one can alternatively use the following equivalent markup in Sitemaps:


http://www.example.com/en
rel="alternate"
hreflang="gr"
href="http://www.example.com/gr" />
rel="alternate"
hreflang="en"
href="http://www.example.com/en" />


http://www.example.com/gr
rel="alternate"
hreflang="gr"
href="http://www.example.com/gr" />
rel="alternate"
hreflang="en"
href="http://www.example.com/en" />