A `sitemap.xml` is a file used by websites to inform search engines about the pages available for crawling. Here are some key points about it:
- Purpose: Helps search engines understand the structure of your website.
- Format: Written in XML format, which is machine-readable.
- Contents: Lists URLs of the website along with metadata such as:
- Last modified date
- Change frequency (how often the page is updated)
- Priority (importance of a page relative to others)
- Submission: Can be submitted to search engines via their webmaster tools.
- Benefits: Improves indexing of your site, potentially leading to better search visibility.
To create a simple `sitemap.xml`, you could use the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>http://www.example.com/</loc>
<lastmod>2023-01-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-01-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
This example includes two pages, but you can add more as needed.