A `sitemap.xml` file is used to inform search engines about the pages on a website that are available for crawling. It helps improve the visibility of the site in search results. Here’s a simple outline of what a `sitemap.xml` file contains:
- URL Set: The main container for the URLs.
- URL Entry: Each individual URL entry includes:
- loc: The location of the page.
- lastmod: The last modification date of the page.
- changefreq: How often the page is likely to change (e.g., daily, weekly).
- priority: The priority of the page relative to other pages on the site (scale from 0.0 to 1.0).
Here is a basic 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>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>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Using a `sitemap.xml` file can help search engines crawl your site more effectively, potentially leading to better indexing and higher rankings in search results.