A `sitemap.xml` file is an XML document that helps search engines understand the structure of your website. It provides a list of the pages on your site, allowing search engines to crawl them more efficiently. Here's a basic overview of its structure:
- XML Declaration: Indicates that the file is an XML document.
- URL Set: The root element that contains all the URLs.
- URL Entry: Each individual URL is enclosed in a url tag.
- Child Elements: Each url tag can contain:
- loc: The location of the URL.
- lastmod: The last modification date of the URL.
- changefreq: How frequently the URL is likely to change.
- priority: The priority of the URL relative to other URLs on your site.
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>daily</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 index your pages properly and can improve your site's visibility in search