A `sitemap.xml` file is an XML file that lists the URLs for a website along with additional metadata about each URL. This helps search engines like Google to crawl the site more effectively.
Here are the main components of a `sitemap.xml` file:
- urlset: The root element that contains all the URLs.
- url: Each URL entry is wrapped in this tag.
- loc: Specifies the location (URL) of the page.
- lastmod: Indicates the last modification date of the page.
- changefreq: Suggests how frequently the page is likely to change (e.g., daily, weekly).
- priority: Indicates the priority of the URL relative to other URLs on the site (range from 0.0 to 1.0).
Here is a simple example of a `sitemap.xml` file:
http://www.example.com/
2023-10-01
daily
1.0
http://www.example.com/about
2023-09-20
monthly
0.8
Make sure to keep your `sitemap.xml` file updated whenever you add or remove pages from your website to ensure that search engines can crawl your site efficiently.