A `sitemap.xml` file is an important tool for search engines to understand the structure of your website. It helps them crawl your site more effectively. Here’s a simple outline of what a `sitemap.xml` file typically includes:
- XML Declaration: The file should start with an XML declaration to define the version and encoding.
- URL Set: The main container for all the URLs in the sitemap.
- URL Entries: Each URL entry consists of:
- loc: The URL of the page.
- lastmod: The date when the page was last modified (optional).
- changefreq: How frequently the page is likely to change (optional).
- priority: The priority of the page relative to other URLs on the site (optional).
Here is a basic example of what a `sitemap.xml` file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2023-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://www.example.com/about</loc>
<lastmod>2023-09-15</lastmod>
<changefreq>yearly</changefreq>
<priority>0.5</priority>
</url>
</urlset>
Ensure that your `sitemap.xml` file is accessible at the root of your domain (e.g., `https://www.example.com/sitemap.xml`) and consider submitting it to search engines like