The team behind OnlineTools4Free — building free, private browser tools.
Published Apr 1, 2026 · 7 min read · Reviewed by OnlineTools4Free
How to Create an XML Sitemap
What Is an XML Sitemap
An XML sitemap is a file that lists every page on your website that you want search engines to find. It lives at a predictable URL — typically yoursite.com/sitemap.xml — and follows a standardized format defined by the sitemaps.org protocol. Search engine crawlers read this file to discover pages they might otherwise miss during regular crawling.
The sitemap does not replace organic crawling. Google, Bing, and other search engines still follow links on your pages to discover content. The sitemap supplements this process by providing a complete directory of your site. Think of it as handing a librarian a catalog of every book on your shelves instead of making them walk every aisle and check every shelf by hand.
Small sites with strong internal linking often rank fine without a sitemap. But for sites with hundreds or thousands of pages, sites with pages that have few inbound links, newly launched sites with minimal backlinks, or sites with frequently changing content, a sitemap meaningfully accelerates discovery and indexing. Google Search Console data consistently shows that pages listed in sitemaps get indexed faster than pages discovered through crawling alone.
Sitemap Structure and Format
An XML sitemap follows a strict format. The root element is <urlset> with the sitemaps.org namespace. Inside, each page gets a <url> element containing a <loc> tag with the full URL. Optional tags include <lastmod> (last modification date), <changefreq> (how often the page changes), and <priority> (relative importance within your site, from 0.0 to 1.0).
In practice, Google largely ignores <changefreq> and <priority> — they crawl based on their own assessment of update frequency and page importance. The <lastmod> tag is useful only when it reflects genuine content changes, not when it updates every time the page template renders. Dishonest lastmod dates (setting every page to today's date) can cause Google to distrust your sitemap entirely.
A single sitemap file can contain up to 50,000 URLs and must not exceed 50 MB uncompressed. Sites exceeding these limits use a sitemap index file that references multiple sitemap files. Large e-commerce sites with millions of products might have dozens of individual sitemap files organized by category, product type, or date range, all referenced from a master sitemap index.
Specialized sitemap types exist for specific content: image sitemaps add image metadata (caption, title, license), video sitemaps include duration and thumbnail URLs, and news sitemaps flag recent articles for Google News indexing. These extensions use additional XML namespaces alongside the standard sitemap namespace.
Generating Your Sitemap
Static sites can generate sitemaps at build time. Most static site generators (Next.js, Gatsby, Hugo, Jekyll) have sitemap plugins that automatically create an XML file from your page routes during the build process. This is the most reliable method because the sitemap always matches your deployed pages exactly.
Dynamic sites with content management systems typically have sitemap plugins. WordPress sites use Yoast SEO or Rank Math, which generate sitemaps automatically and update them when content changes. Shopify, Squarespace, and Wix generate sitemaps by default. These automated solutions handle most use cases without manual intervention.
For custom-built sites without a CMS or framework plugin, you have two options: generate the sitemap programmatically from your database or URL structure, or use a crawler-based generator that spiders your site and builds the sitemap from discovered URLs. The programmatic approach is more reliable because it knows about all pages, including those with no inbound links. The crawler approach is useful for auditing — comparing the crawled sitemap against your expected page list reveals orphaned pages and broken internal links.
Online sitemap generators work by crawling your live site. They start from your homepage, follow every internal link, and compile the discovered URLs into XML format. Crawl depth and page limits vary by tool. Free generators typically cap at 500 pages, which suffices for most small to medium sites.
Submitting to Search Engines
After generating your sitemap, submit it through Google Search Console and Bing Webmaster Tools. In Google Search Console, navigate to Sitemaps in the left menu, enter your sitemap URL, and click Submit. Google will fetch and validate the file, reporting any errors (malformed XML, unreachable URLs, URLs blocked by robots.txt).
You can also reference your sitemap in your robots.txt file by adding a line: Sitemap: https://yoursite.com/sitemap.xml. This tells any crawler that respects robots.txt where to find your sitemap without requiring manual submission to each search engine. It is a passive discovery mechanism that works alongside direct submission.
After submission, monitor the sitemap report in Search Console. It shows how many URLs were submitted, how many were indexed, and reasons for any exclusions (noindex tags, redirects, 404 errors, duplicate content). A large gap between submitted and indexed URLs signals content quality issues, technical problems, or crawl budget limitations that need investigation.
Update your sitemap whenever you add or remove pages. For sites with frequent changes (news sites, e-commerce with daily product additions), automate sitemap generation as part of your publishing workflow. Stale sitemaps listing removed pages waste crawl budget and can slow down indexing of your actual content.
Generate Your Sitemap
Our Sitemap Generator creates a valid XML sitemap from a list of URLs you provide. Paste your URLs, set optional lastmod dates and priority values, and download the finished XML file ready for upload to your server. The generator validates URL format and removes duplicates automatically. For quick sitemap creation without installing plugins or writing scripts, it handles the XML formatting so you can focus on your URL list.
Sitemap Generator
Generate valid XML sitemaps with priority, changefreq, and lastmod for every URL.
OnlineTools4Free Team
The OnlineTools4Free Team
We are a small team of developers and designers building free, privacy-first browser tools. Every tool on this platform runs entirely in your browser — your files never leave your device.
