A *sitemap.xml* file is an XML file that lists the URLs for a website, helping search engines understand its structure. Here are some key elements typically found in a *sitemap.xml*:
- <urlset>: The root element that contains all the <url> entries.
- <url>: An element for each URL on the site.
- <loc>: The location of the URL (the actual web address).
- <lastmod>: The date the URL was last modified.
- <changefreq>: How frequently the URL is likely to change (e.g., daily, weekly).
- <priority>: The priority of the URL relative to other URLs on the site (scale from 0.0 to 1.0).
Here is 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>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>
This file should be placed in the root directory of the website and can be submitted to search engines to improve indexing.