A `sitemap.xml` file is an important tool for search engine optimization (SEO). It provides search engines with a roadmap of your website's content. Below are the key components and structure of a `sitemap.xml`:
- XML Declaration: This should be the first line of your sitemap.
- URL Set: The root element of the sitemap.
- URL Entries: Each URL entry contains details about a specific page.
Here is a simple example of a `sitemap.xml` structure:
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
- loc: The URL of the page.
- lastmod: The last modified date of the page.
- changefreq: How frequently the page is likely to change.
- priority: The priority of the page relative to other pages on your site.
Make sure to update your `sitemap.xml` regularly to reflect changes in your website's structure and content. This helps search engines index your site more effectively.