A `sitemap.xml` file is an XML document that contains a list of URLs for a website. It helps search engines like Google understand the structure of your site and find all its pages. Here’s a simple breakdown of what a `sitemap.xml` typically includes:
- URL Structure: Each URL is wrapped in <url> tags.
- Loc: Each URL is defined using the <loc> tag.
- Last Modified: You can include the <lastmod> tag to indicate when the page was last updated.
- Change Frequency: The <changefreq> tag indicates how often the page is likely to change.
- Priority: The <priority> tag indicates the importance of the page relative to other pages on the site.
Here’s a simple example of a `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>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>http://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
This file helps search engines effectively crawl your site and index its pages for better visibility in search results.