A `sitemap.xml` file is an XML file that helps search engines understand the structure of your website. It provides a list of the pages on your site, ensuring that search engines can discover and index them efficiently. Here are some key components of a `sitemap.xml` file:
- XML Declaration: Indicates the file is an XML document.
- URL Set: The root element for the sitemap, usually <urlset>.
- URL Entries: Each page on your site is represented by a <url> entry, which contains:
- <loc>: The URL of the page.
- <lastmod>: The last modification date of the page.
- <changefreq>: The frequency of changes (e.g., daily, weekly).
- <priority>: The priority of the page relative to others.
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>
&