A sitemap.xml file is an important component of a website's SEO strategy. It helps search engines understand the structure of your site and find all the pages you want indexed. Below is a simple overview of what a sitemap.xml file typically includes:
- XML Declaration: Indicates that the document is an XML file.
- urlset Element: The root element that contains all url entries.
- url Element: Represents a single URL on your website and includes several child elements:
- loc: The URL of the page.
- lastmod: The date the page was last modified.
- changefreq: How frequently the page is likely to change (e.g., daily, weekly).
- priority: The priority of this URL relative to other URLs on your site (scale of 0.0 to 1.0).
Here is a simple example of a sitemap.xml structure:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image">
<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>