Practical guideUpdated

How to create an XML sitemap

Most sites get an XML sitemap automatically from their CMS: WordPress, Shopify, Webflow, Wix, and Squarespace all generate one. If yours does not, use an online sitemap generator that crawls the site, or generate the file in your build or server code from your list of public pages. Include only canonical, indexable URLs, split files above 50,000 URLs, reference the sitemap in robots.txt, and submit it in Search Console.

This page covers creating the file. For examples of the XML format, see our XML sitemap examples guide; for planning site structure visually, see the sitemap template guide. The method depends on how your site is built.

By , Founder, SerionFlow

What we measured ·

What Google shows for "how to create sitemap" right now

Method: Live Google results (United States, desktop, English) for "how to create sitemap" retrieved through DataForSEO's SERP API on 2026-10-22. Page types are our own classification of each ranking URL.

The top 8 organic results for "how to create sitemap" were 4 guides or explainers, 3 product or service pages, 1 video. The first three were www.gloomaps.com, www.sitemaps.org, www.wix.com.

Google showed an AI Overview for this query, citing 6 source domains including developers.google.com, miro.com, www.xml-sitemaps.com, www.youtube.com. Pages that state the answer directly and early are the ones an Overview can quote.

People Also Ask listed: "What is the best program to create a map?"; "How to make a map for your website?"; "What is the best tool for generating a sitemap?"; "Is a sitemap necessary for SEO?". The sections below answer the ones within this page's scope.

Top organic results for "how to create sitemap", 2026-10-22
PositionDomainPage type
1www.gloomaps.comProduct or service page
2www.sitemaps.orgProduct or service page
3www.wix.comGuide or explainer
4blog.hubspot.comGuide or explainer
5milanote.comGuide or explainer
6www.youtube.comVideo
01

Method 1: your CMS or plugin

Check these defaults first.

Automatic sitemaps by platform
PlatformSitemap locationControl
WordPress core/wp-sitemap.xmlFilters in code
WordPress with Yoast or Rank Math/sitemap_index.xmlPlugin settings
Shopify/sitemap.xmlAutomatic
Webflow/sitemap.xmlAuto-generate toggle in SEO settings, per-page exclusion
Wix and Squarespace/sitemap.xmlAutomatic, with page visibility settings
02

Method 2: an online generator

Generators crawl your site from the homepage, follow links, and produce a sitemap file to download and upload to your site root. They work for small static sites without a CMS. Drawbacks: they only find pages linked from others, may include URLs you did not want, and the file goes stale whenever you add pages. Regenerate after every change, or move to an automated method.

03

Method 3: generate it in code

For custom sites and apps, generate the sitemap from the same source that defines your pages: the router, a content registry, or the database. Output a urlset with one url element per public page and a lastmod from the page's real modification date. Frameworks often have helpers, such as Next.js's sitemap route. On serionflow.com a build script generates a sitemap index and child sitemaps from the page registry, and pages scheduled for a later release are excluded automatically, so the sitemap always matches what is live.

04

What to include and exclude

Include every page you want indexed, using its canonical URL. Exclude redirects, noindex pages, error pages, parameter variants, internal search results, and login or account pages. Keep lastmod accurate; do not set every URL to the build date. For sites over 50,000 URLs or 50 MB per file, use a sitemap index; splitting by page type is useful even below that limit, because Search Console reports indexing per sitemap.

05

Publishing and submitting

Serve the file at a stable URL with a 200 status and XML content type. Add a Sitemap line to robots.txt. Submit it in Google Search Console and Bing Webmaster Tools. Check back after a day to confirm it was read without errors. Our free sitemap checker validates the file and flags URLs that redirect, return errors, or carry noindex. SerionFlow is the wrong tool for your site's main sitemap; it maintains a sitemap only for the pages it serves.

Clear answers

Frequently asked questions

What is the best tool for generating a sitemap?

+

Your CMS or SEO plugin, if you use one, because it updates automatically. For custom sites, generating it from your code or build is more reliable than a crawler-based generator.

How often should I update my sitemap?

+

Whenever pages are added, removed, or significantly changed. Automated generation keeps it current without manual work.

About the author

· Founder, SerionFlow

Shadrack builds SerionFlow's site research, page generation, and Search Console tooling, and runs the free tools these guides pair with. Search Console figures cited on these pages come from serionflow.com's own property.

Continue exploring

Related SerionFlow resources

More in Guides

All guides

Make the next move obvious

Let SerionFlow turn your market evidence into momentum.

Confirm the market, rank the opportunities that matter, create brand matched pages on your domain, and keep moving with controlled weekly intelligence.

Choose how SerionFlow uses cookies.

Essential cookies keep the site secure and working. Product analytics helps us improve reliability. Optional cookies help us remember preferences and improve campaigns. You can change optional cookies anytime in Cookie Settings.