A `sitemap.xml` file is an XML file that helps search engines index your website more effectively. It provides information about the pages, videos, and other files on your site, and the relationships between them. Here’s a simple overview of how to create and structure a `sitemap.xml` file:
- XML Declaration: Start with the XML declaration at the top.
- URL Set: Use the urlset element to enclose all url entries.
- URL Entry: Each url entry should include the following elements:
- 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.
Here’s a simple example of a `sitemap.xml` file:
https://www.example.com/
2023-10-01
daily
1.0
https://www.example.com/about
2023-09-25
monthly
0.8
https://www.example.com/contact
2023-09-20
yearly
0.5
Make sure to update your `sitemap.xml` regularly to reflect changes on your site. You can