A sitemap.xml file is an XML file that provides search engines with information about the pages on your website. It helps them crawl your site more intelligently. Here are the key components of a sitemap.xml:
- XML Declaration: Indicates that the document is in XML format.
- urlset: The root element that contains all the URLs.
- url: Each individual URL entry within the sitemap.
- loc: The 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).
- priority: The priority of the page relative to other pages on the site.
Here is a simple example of a sitemap.xml:
http://www.example.com/
2023-10-01
daily
1.0
http://www.example.com/about
2023-09-25
monthly
0.8
This file helps search engines understand the structure and content of your website, which can improve your SEO.