A sitemap.xml file is an XML document that outlines the structure of a website. It helps search engines understand the content and organization of the site. Here are the key components:
- XML Declaration: Specifies the XML version and encoding.
- urlset: The root element that contains all the URL entries.
- url: Each entry for a specific page on the site, which includes:
- loc: The URL of the page.
- lastmod: The last modification date of the page.
- changefreq: How frequently the page is expected to change.
- 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-01-01
monthly
1.0
http://www.example.com/about
2023-01-01
monthly
0.8
This file should be placed at the root of the website to be easily accessible by search engines.