A `sitemap.xml` file is an important component for websites, as it helps search engines understand the structure of your site. Here’s a simple overview of its elements:
- XML Declaration: Indicates that the file is an XML document.
- urlset: The root element that contains all the URLs.
- url: Each URL entry must be wrapped in this tag.
- loc: Specifies the location (URL) of the page.
- lastmod: (Optional) Indicates the last modification date of the URL.
- changefreq: (Optional) Suggests how frequently the page is likely to change.
- priority: (Optional) Indicates the priority of the URL relative to other URLs on the site.
An example of a simple `sitemap.xml` is shown below:
https://www.example.com/
2023-10-01
daily
1.0
https://www.example.com/about
2023-09-15
monthly
0.8
Make sure to update your `sitemap.xml` regularly to reflect changes on your website!