sitemap.xml
A `sitemap.xml` file is an XML document that lists the pages of a website to help search engines like Google crawl the site more effectively. Here’s a basic overview of its structure and purpose:
Purpose of sitemap.xml:
- Improves site visibility in search engines
- Provides search engines with information about site structure
- Helps prioritize pages for crawling
Basic Structure of sitemap.xml:
- urlset: The root element that contains all URLs.
- url: Each URL entry in the sitemap.
- loc: The URL of the page.
- lastmod: The date the page was last modified (optional).
- changefreq: How frequently the page is likely to change (optional).
- priority: The priority of the page relative to other pages (optional).
Example of a simple sitemap.xml:
<?xml-stylesheet type="text/xsl" href="sitemap.xsl" ?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap-image/1.1">
<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-10-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.8</priority>
</url>
</urlset>