A `sitemap.xml` file is an XML document that lists the URLs for a website and provides important metadata about each URL. This helps search engines like Google crawl your site more effectively. Here’s a simple breakdown of its structure:
- XML Declaration: Indicates that the document is in XML format.
- urlset: The root element that contains all the URLs.
- url: Each URL entry contains the following elements:
- loc: The URL of the page.
- lastmod: The date the page was last modified.
- changefreq: How frequently the page is likely to change (e.g., daily, weekly, monthly).
- priority: The priority of the page relative to other pages (from 0.0 to 1.0).
Here is a simple example of a `sitemap.xml` file:
http://www.example.com/
2023-10-01
monthly
1.0
http://www.example.com/about
2023-09-15
yearly
0.5
This structure allows search engines to understand the content and layout of your site, improving its visibility in search results.