A `sitemap.xml` file is an XML document that helps search engines understand the structure of a website. It contains a list of URLs for a site, along with additional information about each URL. Here’s a simple breakdown of its structure:
- XML Declaration: The file typically begins with an XML declaration.
- URL Set: The main container for the URLs.
- Individual URLs: Each URL is defined with specific tags:
- <url>: Starts the definition of a URL entry.
- <loc>: Specifies the URL of the page.
- <lastmod>: Indicates the last modification date of the page.
- <changefreq>: Suggests how frequently the page is likely to change.
- <priority>: Indicates the priority of the page relative to other pages on the site.
Here’s a simple example of a `sitemap.xml` file:
<?xml-stylesheet type="text/xsl" href="sitemap.xsl"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>