A `sitemap.xml` file is an XML document that helps search engines understand the structure of a website. It lists all the important pages on the site, making it easier for search engines to crawl and index them.
Here’s a simple structure of a `sitemap.xml` file:
```xml
https://www.example.com/
2023-10-01
daily
1.0
https://www.example.com/about
2023-09-15
monthly
0.8
https://www.example.com/contact
2023-09-20
yearly
0.5
```
### Key elements of a `sitemap.xml`:
- <url>: Represents a single URL on the site.
- <loc>: The location (URL) of the page.
- <lastmod>: The date the page was last modified.
- <changefreq>: How often the page is likely to change (e.g., daily, weekly, monthly).
- <priority>: The priority of the page relative to other pages on the site (ranges from 0.0 to 1.0).
Using a `sitemap.xml` file can improve a website's SEO by ensuring that search engines can easily find and index all relevant pages.