How to Create an XML Sitemap and Submit It

How to Create an XML Sitemap and Submit It

An XML sitemap is a list of your important URLs that you hand to search engines so they can find and crawl your pages efficiently. It will not make weak pages rank, but it helps Google discover everything, especially on big or poorly linked sites. Here is how to make one.

What goes in it

A sitemap lists URLs you want indexed. Each entry can include optional hints:

  • loc: the URL (required).
  • lastmod: when the page last changed. Genuinely useful; keep it accurate.
  • changefreq: how often it changes. A weak hint that Google mostly ignores, but harmless.
  • priority: relative importance from 0.0 to 1.0. Also a weak hint.

Only include URLs that return 200, are canonical, and are not blocked by robots or noindex. A sitemap full of redirects and dead pages wastes crawl budget.

Build it

  1. Open the XML Sitemap Generator.
  2. Paste your URLs, one per line.
  3. Choose whether to add lastmod, changefreq, and priority, then copy or download sitemap.xml.

Save the file as sitemap.xml at your site root.

Submit it

  1. Add a line to your robots.txt: Sitemap: https://example.com/sitemap.xml.
  2. In Google Search Console, open Sitemaps and submit the URL.
  3. Do the same in Bing Webmaster Tools.

Size limits

A single sitemap holds up to 50,000 URLs or 50 MB uncompressed. Past that, split into multiple sitemaps and list them in a sitemap index file.

A note for WordPress

WordPress and SEO plugins generate sitemaps automatically. This tool is most useful for static sites, custom setups, or a quick one-off sitemap for a specific list of URLs.

List your live, canonical URLs, add accurate lastmod, save as sitemap.xml, and submit it in Search Console. Search engines will find your pages faster.

← All posts