Sitemap files are XML documents that contain URLs for the pages of your site. A simple sitemap file would look similar to this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <url>
      <loc>http://www.example.com/</loc>
   </url>
   <url>
      <loc>http://www.example.com/contact/</loc>
   </url>
</urlset>

Each <url> tag is used to specify the URL of a single page. This tag has several child tags:

For more information about these tags, see:

http://www.sitemaps.org/protocol.php
Sitemap Indexes

A single site can have more than one sitemap. Using multiple sitemaps can help make your sitemaps more manageable; for example, you can have a separate sitemap for each area of a site. On very large sites, having multiple sitemaps may be necessary to ensure that no individual sitemap exceeds the maximum file size (10 Mb or 50,000 URLs).

To use multiple sitemaps, you list them all in an XML file called a sitemap index. For example:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
   <sitemap>
      <loc>http://www.example.com/sitemap.xml</loc>
   </sitemap>
   <sitemap>
      <loc>http://www.example.com/sitemap2.xml</loc>
   </sitemap>
</sitemapindex>

The <loc> tag is a required child tag of the <sitemap> tag; it specifies the URL of a sitemap file. The <sitemap> tag also has an optional <lastmod> child tag that specifies the date the sitemap file was last modified.


Copyright © 1997, 2016 Oracle and/or its affiliates. All rights reserved. Legal Notices