sitemap.xml
A sitemap.xml file is an XML document that lists the URLs of a website, helping search engines to crawl and index the site more effectively. Here’s a simple breakdown of its structure and purpose:
Purpose of sitemap.xml:
- Improves SEO by informing search engines about pages on your site.
- Helps search engines find new or updated content.
- Can include metadata about each URL, such as last modified date and change frequency.
Basic Structure of sitemap.xml:
- urlset: The root element that contains all the url entries.
- url: Each entry representing a single webpage.
- loc: The URL of the webpage.
- lastmod: The date the page was last modified.
- changefreq: The frequency of updates (e.g., daily, weekly).
- priority: The priority of the page relative to other pages on the site.
Example of a simple sitemap.xml:
<?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>yearly</changefreq>
<priority>0.8</priority>
</url>
</urlset