A `sitemap.xml` file is used to inform search engines about the pages on your website that are available for crawling. Here are the key components of a `sitemap.xml` file:
- URLSet: The root element of the sitemap.
- URL: Each entry in the sitemap represents a URL on your site.
- Loc: The location of the URL.
- LastMod: The date when the URL was last modified.
- ChangeFreq: Indicates how frequently the page is likely to change (e.g., daily, weekly, monthly).
- Priority: The priority of the page relative to other pages on your site (range from 0.0 to 1.0).
Here’s an example of a simple `sitemap.xml` structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-20</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Make sure to keep your `sitemap.xml` updated as you add or remove pages from your site to ensure search engines can effectively crawl your content.