sitemap.xml
A `sitemap.xml` file is an XML file that helps search engines understand the structure of your website. It lists all the important pages and can include additional metadata about each page. Here’s a simple breakdown of its components:
- XML Declaration: Indicates that the file is an XML document.
- URL Set: The root element, usually
<urlset>, which may include attributes like xmlns.
- URL Entry: Each page is represented by a
<url> element, containing:
- loc: The URL of the page.
- lastmod: The last modification date of the page (optional).
- changefreq: How often the page is likely to change (optional).
- priority: The priority of the page relative to other pages (optional).
Here is a simple example of a `sitemap.xml`:
<?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-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Including a `sitemap.xml` file can help improve your website's SEO by ensuring that search engines can find and