Published: May 26, 2026
An XML sitemap is a file that lists all the important pages on your website and tells search engines like Google, Bing, and Yandex about them. Think of it as a roadmap for crawlers — you hand them a structured list of every URL you want indexed, along with metadata like when the page was last updated, how often it changes, and how important it is relative to other pages on your site.
Search engines are good at finding pages through internal links, but they're not perfect. Deep pages, new pages with no backlinks, and JavaScript-rendered content can easily slip through the cracks. An XML sitemap ensures nothing important gets left behind.
Here's why every serious website should have one:
lastmod field tells crawlers to re-check it.Almost any website with more than a handful of pages benefits from a sitemap. Even small blogs and portfolio sites see faster indexing after adding one.
A sitemap follows a strict XML schema defined by sitemaps.org. Every sitemap needs a <urlset> wrapper with the proper namespace, and each page is a <url> entry containing the following elements:
| Element | Required | Description |
|---|---|---|
loc | Yes | Full URL of the page (must be URL-encoded and consistent with your site's canonical URL). |
lastmod | No | Date of last modification in W3C datetime format (2026-05-26 or 2026-05-26T10:00:00+00:00). |
changefreq | No | How often the page changes: always, hourly, daily, weekly, monthly, yearly, never. |
priority | No | Relative priority from 0.0 to 1.0. Default is 0.5. Use sparingly — this only matters relative to other pages on your own site. |
Here's a complete sitemap example for a small blog:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://wangtoolbox.com/</loc>
<lastmod>2026-05-26</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://wangtoolbox.com/blog/</loc>
<lastmod>2026-05-26</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://wangtoolbox.com/tools/sitemap-generator.html</loc>
<lastmod>2026-05-01</lastmod>
<changefreq>monthly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://wangtoolbox.com/blog/sitemap-xml-seo-guide.html</loc>
<lastmod>2026-05-26</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
</urlset>
Google accepts sitemaps with up to 50,000 URLs and a maximum uncompressed file size of 50 MB. If your site is larger than that, you need to split your sitemap into multiple files and create a sitemap index file that references them all:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://wangtoolbox.com/sitemap-pages.xml</loc>
<lastmod>2026-05-26</lastmod>
</sitemap>
<sitemap>
<loc>https://wangtoolbox.com/sitemap-posts.xml</loc>
<lastmod>2026-05-26</lastmod>
</sitemap>
<sitemap>
<loc>https://wangtoolbox.com/sitemap-images.xml</loc>
<lastmod>2026-05-26</lastmod>
</sitemap>
</sitemapindex>
Once your sitemap is ready, you need to let search engines know it exists. Here are the three common methods:
Log into Google Search Console, select your property, go to Sitemaps in the left sidebar, enter your sitemap URL (https://wangtoolbox.com/sitemap.xml), and click Submit. Google will report how many URLs were discovered and flag any errors.
Add the sitemap directive to your robots.txt file. This is the simplest approach and works for all compliant search engines:
User-agent: *
Allow: /
Sitemap: https://wangtoolbox.com/sitemap.xml
You can also ping Google's crawler directly using HTTP requests:
# Ping Google
https://www.google.com/ping?sitemap=https://wangtoolbox.com/sitemap.xml
# Ping Bing
https://www.bing.com/ping?sitemap=https://wangtoolbox.com/sitemap.xml
Even experienced developers make these errors. Watch out for:
noindex meta tag or X-Robots-Tag: noindex, remove it from your sitemap. You're sending mixed signals.<loc> must be a full absolute URL with the correct protocol (https://).&, <, and spaces must be percent-encoded. For example, & becomes &.Writing XML by hand is tedious and error-prone, especially for large sites. Use our free sitemap generator to create a properly formatted XML sitemap in seconds. Just enter your domain, customize priority and changefreq values, and download your file. It handles URL encoding, valid XML structure, and proper namespace declarations automatically.
Our sitemap generator also supports generating sitemap index files for large sites, so you can manage thousands of URLs across multiple sitemap files with a single tool. Whether you run a 5-page portfolio or a 100,000-page e-commerce store, having a clean, valid sitemap is one of the easiest SEO wins you can get.
XML sitemaps are a fundamental part of technical SEO. They don't guarantee higher rankings, but they make sure your pages actually get found and indexed — which is a prerequisite for ranking at all. Spend 10 minutes setting one up, keep it updated, and you'll never wonder why a new page isn't showing up in search results.
Start with our sitemap generator, submit the output to Google Search Console, and you're done. One small file, big impact.