A `sitemap.xml` file is an important tool for SEO and helps search engines understand the structure of a website. Here’s a simple overview of its components:
- XML Declaration: Indicates the document is in XML format.
- URL Set: The root element that contains all the URLs.
- URL Entry: Each URL entry is wrapped in url tags.
- Child Elements: Each url can contain:
- loc: The URL of the page.
- lastmod: The last modified date of the page.
- changefreq: How often the page is likely to change.
- priority: The priority of the page relative to other pages.
Here is a basic example of a `sitemap.xml`:
https://www.example.com/
2023-10-01
monthly
1.0
https://www.example.com/about
2023-09-15
yearly
0.8
This format helps search engines effectively index the pages of your website.