A `sitemap.xml` file is an XML file that provides a list of URLs for a website, helping search engines like Google to crawl the site effectively. Here’s a simple overview of its structure and elements:
- XML Declaration: Indicates that the document is an XML file.
- URL Set: The root element that contains all the URLs.
- URL Entry: Each URL is wrapped in a url tag.
- Child Elements: Each url element can contain:
- loc: The location of the URL.
- lastmod: The last modified date of the URL.
- changefreq: The frequency of changes (e.g., daily, weekly).
- priority: The priority of the URL relative to other URLs 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>monthly</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>
This structure helps search