A URL list is the most common starting point for a sitemap that nobody wants to build by hand: an export from a crawler, a product feed, a list of landing pages after a migration, or a set of static pages that no CMS manages. Turning that list into valid XML sounds trivial until the list passes 50,000 rows and Google's limits start to matter. This guide walks through the format, the limits, how to split a big list into several files under one sitemap index, and the checks that catch the usual mistakes before Search Console does.
What an XML sitemap file must contain
A sitemap is a UTF-8 XML file with a urlset root element in the sitemaps.org namespace and one url entry per page. Inside each entry, loc holds the address. That is the whole required structure; everything else is optional.
Google's rules for the addresses themselves are short:
- Absolute URLs only. Google crawls the URLs exactly as listed, so a relative path such as /pricing/ is not acceptable. Write https://example.com/pricing/.
- Canonical URLs only. List the version you want shown in search results, not the parameter variants, tracking links or redirecting addresses.
- Escaped characters. An ampersand in a query string must be written as & inside the file, or the XML is invalid.
- UTF-8 encoding. The file must be UTF-8 encoded.
Of the optional tags, only one is worth thinking about. Google ignores priority and changefreq. It uses lastmod only when the value is consistently and verifiably accurate, meaning it reflects the last significant change to the main content, structured data or links. If you don't know the real dates, leave lastmod out rather than stamping every URL with today's date.
The limits: 50,000 URLs or 50 MB per file
A single sitemap may hold up to 50,000 URLs or 50 MB uncompressed, whichever comes first. A list bigger than that has to be split into several files. Two consequences follow:
- Count both limits. 50,000 short URLs fit comfortably under 50 MB. 50,000 very long URLs with many parameters might not. A splitter that counts only rows can still produce an oversized file.
- Split by a stable rule. If file 1 always holds the blog and file 2 the product pages, the Sitemaps report in Search Console shows you per-section numbers. A split by section is more useful than a split by row number.
Many files, one submission: the sitemap index
When the list needs several files, you tie them together with a sitemap index: an XML file with a sitemapindex root and one sitemap entry per file, each with its own loc. You submit the index once and Google discovers the files listed in it.
The index has its own rules. It can list up to 50,000 sitemaps. The sitemaps it references must be on the same site as the index (unless you have set up cross-site submission) and in the same directory as the index or below it. Search Console accepts up to 500 sitemap index files per site, which is far more than most sites ever need.
Location matters for ordinary sitemaps too. A sitemap covers only URLs in its own directory and below unless it is submitted through Search Console, so the site root is the safe place for both the index and the files.
Building the files from a URL list, step by step
- Clean the list first. Remove duplicates, tracking parameters such as utm_source, redirecting addresses and pages that return an error or carry noindex. A sitemap that lists broken or non-canonical URLs teaches you nothing and makes the Sitemaps report noisy.
- Check that every URL is on one host. A sitemap referenced from a site's robots.txt should list only that site's URLs. A list that mixes www and non-www, or http and https, needs to be normalised before it goes in.
- Generate the files. Paste or upload the list and set the base URL where the files will live; this free generator turns a URL list into sitemap files, splits at 50,000 URLs or 50 MB, escapes special characters, warns about mixed hosts and creates the sitemap index automatically when more than one file is needed. It runs in the browser, so the list is not uploaded anywhere.
- Upload to the site root. Put sitemap_index.xml and the numbered files next to each other at the root, for example https://example.com/sitemap_index.xml and https://example.com/sitemap-1.xml.
- Reference the index in robots.txt. Add a line such as Sitemap: https://example.com/sitemap_index.xml. The line can sit anywhere in the file and can be repeated for several sitemaps.
- Submit the index in Search Console. Open the Sitemaps report and add the index URL. The report then shows when Google last read each file and any processing errors.
Checks before and after submission
- Open each file in a browser. A parsing error shows up immediately; a page of raw text instead of XML usually means a wrong content type or an unescaped character.
- Spot-check URLs from each file. Pick a handful from the start, middle and end of every file and make sure they return 200 and are canonical.
- Compare counts. The number of URLs in your list, in the files and in the Sitemaps report should match. A gap points to rows that were dropped during cleaning or rejected during processing.
- Remember what a sitemap is. Submission is a hint. Google may not download a sitemap or use it for crawling, and listing a URL does not guarantee it will be indexed.
When the list comes from an existing sitemap
The reverse task is just as common: you have a live sitemap, often an index with dozens of files, and you need the plain URL list to clean, compare or resubmit. Rather than copying from raw XML, you can extract every URL from a sitemap into a text file, clean it, and rebuild the sitemap from the cleaned list with the steps above.
FAQ
How many URLs can one sitemap hold?
Up to 50,000 URLs or 50 MB uncompressed, whichever limit is reached first.
Should I add priority and changefreq?
No. Google ignores both values.
Do I need a sitemap index for a small site?
Only if the URLs don't fit in one file, or if you want separate files per section to read separate numbers in Search Console.
Can one sitemap list pages from several sites?
Only through cross-site submission. A sitemap referenced from a site's robots.txt should list that site's URLs.
Does a sitemap get my pages indexed?
It helps Google discover them. Whether a page is indexed depends on the page itself.
Sources
- Build and submit a sitemap, Google Search Central: developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap
- Manage your sitemaps with sitemap index files, Google Search Central: developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps