An XML sitemap is one of the most fundamental technical SEO documents you can provide for your website. It tells search engines which pages exist, how important they are relative to each other, and how often their content changes — all in a structured format that crawlers can read efficiently.
What is a sitemap.xml?
A sitemap.xml is an XML file that lists the URLs you want search engines to discover and consider for indexing. The format is defined by the Sitemaps 0.9 protocol, jointly supported by Google, Bing, Yahoo, and Ask, and stored at sitemaps.org.
A minimal valid sitemap looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://tools.town/</loc>
</url>
<url>
<loc>https://tools.town/tools/</loc>
<lastmod>2026-06-01</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
</urlset>
Every sitemap must begin with the XML declaration, the <urlset> root element with the correct namespace, and at least one <url> entry containing a <loc> tag.
The four sitemap attributes
<loc> — Required. The full absolute URL of the page, including the scheme (https://). URLs must be percent-encoded (e.g. spaces become %20) and XML special characters must be escaped (& → &).
<lastmod> — Optional. The date the page was last significantly modified, in YYYY-MM-DD format (W3C datetime format is also accepted but the date-only form is most common). This helps crawlers prioritise recently-changed content.
<changefreq> — Optional. A hint about how frequently the content changes. Values: always, hourly, daily, weekly, monthly, yearly, never. Search engines treat this as a hint, not a directive.
<priority> — Optional. A decimal from 0.0 to 1.0 indicating the relative importance of the URL compared to other URLs on the same site. The default is 0.5. Only use priority to differentiate between page types — setting every URL to 1.0 has no effect because the value is relative.
How to structure priority correctly
A common mistake is setting all pages to priority="1.0". Since priority is relative to other pages on the same site, this tells crawlers nothing and they may ignore it. A more useful structure:
- Home page: 1.0
- Category / section pages: 0.8–0.9
- Individual articles or product pages: 0.6–0.7
- Tag, archive, or pagination pages: 0.3–0.5
- Utility pages (privacy policy, contact): 0.2–0.3
Sitemap limits and splitting
Each sitemap file may contain at most 50,000 URLs and must not exceed 50 MB uncompressed. Sites exceeding these limits need multiple sitemap files referenced by a sitemap index:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<sitemap>
<loc>https://tools.town/sitemap-tools.xml</loc>
</sitemap>
<sitemap>
<loc>https://tools.town/sitemap-blog.xml</loc>
</sitemap>
</sitemapindex>
The sitemap.xml generator warns you when you approach the 50,000 URL limit so you can plan your split.
Generating your sitemap
For small sites, you can build the sitemap manually using the sitemap.xml Generator: paste your URLs (one per line), set default changefreq and priority, enable lastmod, and copy the output.
For larger sites, automation is essential. Most CMS platforms have plugins (Yoast, Rank Math for WordPress; Astro Sitemap for Astro) that generate and update sitemaps automatically on each build or publish event.
For static sites built with Hugo, Jekyll, or Astro, sitemap generation is typically a build step that reads your content directory and outputs a fresh sitemap.xml on every deployment.
Referencing your sitemap in robots.txt
The fastest way to ensure Google discovers your sitemap without needing to submit it manually is to reference it in your robots.txt file:
User-agent: *
Allow: /
Sitemap: https://tools.town/sitemap.xml
Google’s crawler reads robots.txt and discovers the sitemap URL automatically. This is especially useful for new sites that have not yet been added to Search Console.
Submitting to Google Search Console
For the fastest indexing, submit your sitemap directly:
- Open Google Search Console and select your property.
- Navigate to Sitemaps in the left sidebar.
- Enter the path to your sitemap (e.g.
sitemap.xml) and click Submit. - Google will crawl the sitemap and report how many URLs were discovered vs. indexed.
Resubmit whenever you make major structural changes to your sitemap (adding new sections, changing URL patterns) to trigger a fresh crawl pass.
Common sitemap mistakes
Including non-canonical URLs — URLs with ?utm_source= parameters, pagination variants, or session IDs should not appear in your sitemap unless they are the canonical version. The sitemap should reflect the canonical URL structure and align with your <link rel="canonical"> tags.
Listing blocked URLs — Never include in your sitemap any URL that is blocked by robots.txt or tagged with noindex. This sends conflicting signals to Google.
Outdated lastmod dates — Setting lastmod to a date far in the past is treated as a hint that the content is stale. Only set lastmod when you have actually modified the content, and keep it accurate.
Missing pages — Your sitemap should include all important indexable pages, including category pages, pagination (if you want them indexed), and filtered landing pages. Use the Robots.txt Generator in tandem to ensure your rules and sitemap entries are consistent.
A valid, up-to-date sitemap is one of the easiest wins in technical SEO — it costs nothing to maintain (with automation) and directly helps every page you want indexed get discovered.