An XML sitemap is a file that lists all important pages on your website, helping search engines discover and crawl your content more efficiently. It acts as a roadmap of your site for search engine crawlers.
Helps search engines find pages, especially new or updated ones
New content can be indexed more quickly
Provides additional info like last modified dates and priority
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://example.com/page/</loc>
<lastmod>2024-01-15</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
| Element | Required | Description |
|---|---|---|
<loc> |
Yes | The full URL of the page |
<lastmod> |
No | Last modification date (YYYY-MM-DD format) |
<changefreq> |
No | How often the page changes (always, hourly, daily, weekly, monthly, yearly, never) |
<priority> |
No | Relative importance (0.0 to 1.0). Default is 0.5 |
For large sites, use a sitemap index to reference multiple sitemap files:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://example.com/sitemap-posts.xml</loc>
<lastmod>2024-01-15</lastmod>
</sitemap>
<sitemap>
<loc>https://example.com/sitemap-products.xml</loc>
<lastmod>2024-01-14</lastmod>
</sitemap>
</sitemapindex>
Lists regular web pages. Most common type.
sitemap.xml
Helps Google discover images for Google Images.
image:image namespace
Provides metadata about videos on your site.
video:video namespace
For Google News publishers. Articles from last 2 days.
news:news namespace
User-agent: *
Disallow: /admin/
Sitemap: https://example.com/sitemap.xml