A sitemap.xml file is an XML file that helps search engines understand the structure of a website. It provides a list of pages and other content on the site, making it easier for search engines to crawl and index the information. Here’s a basic outline of how a sitemap.xml file is structured:
- URL Set: The root element that wraps all the URLs.
- URL Entry: Each URL is defined within a url element, which typically includes:
- loc: The location of the URL.
- lastmod: The date the URL was last modified (optional).
- changefreq: How frequently the content at the URL is expected to change (optional).
- priority: The priority of the URL relative to other pages on the site (optional).
Here’s 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.8
In this example, the sitemap includes two URLs: the homepage and an about page, each with relevant metadata.