A sitemap.xml file is an XML document that provides search engines with information about the pages on a website. It helps with SEO by ensuring that search engines can find and index all relevant pages. Here’s a simple overview of its structure:
- XML Declaration: Indicates that the file is an XML document.
- urlset: The root element that contains all the URLs.
- url: Each entry for a specific URL, which can include:
- loc: The URL of the page.
- lastmod: The date when the page was last modified.
- changefreq: How frequently the page is expected to change (e.g., daily, weekly).
- priority: The priority of the page relative to other pages on the site, with a value between 0.0 and 1.0.
Here’s a basic example of how a sitemap.xml file might look:
<?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>monthly</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 structure helps search engines to efficiently crawl and index the site, improving visibility in search results.