A `sitemap.xml` file is an XML file that helps search engines understand the structure of your website. It provides a list of URLs that you want to be indexed. Here are some key points about it:
- Purpose: To inform search engines about pages on your site that are available for crawling.
- Format: The sitemap is written in XML format.
- Components:
- urlset: A container for the URLs.
- url: Each individual URL entry.
- loc: The location of the URL.
- lastmod: The last modified date of the URL.
- changefreq: How often the page is likely to change.
- priority: The priority of the URL relative to other URLs on the site.
- Benefits:
- Improves indexing of your website.
- Helps search engines discover new or updated content.
- Can specify different attributes for each URL.
Here is an example of a simple `sitemap.xml` file:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/image/1.1">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>