How the Sitemap XML Generator works
The generator reads your list one line at a time and ignores blank lines. Each line must be an absolute URL that starts
with https:// or http://, has a host name, and contains no spaces or # fragment.
Lines that fail are skipped and listed below the output with their line number and the reason, so you can fix them.
Exact duplicates are removed. If some URLs use a different host from the first URL, you get a warning, because
a sitemap may only list URLs from the site it is published on.
The XML follows the sitemaps.org 0.9 protocol. Characters that are special in XML, most often the &
between query parameters, are escaped as entities such as &. <lastmod> can be left
out, set to today's date or set to a date you choose, written in W3C date format (YYYY-MM-DD).
<changefreq> and <priority> are optional; Google ignores both, but other search
engines may read them. A single sitemap can hold at most 50,000 URLs and 50 MB, so larger lists must be split.
How to use the Sitemap XML Generator
- Paste your page URLs, one per line, open a .txt file, or select Load example.
- Choose Last modified (None, Today or Specific date) and, if you want them, a Change frequency and Priority.
- Select Generate sitemap, or press Ctrl + Enter (Cmd + Enter on a Mac), and review any skipped lines or host warnings below the output.
- Download sitemap.xml, upload it to your site, and submit its URL in Google Search Console or Bing Webmaster Tools.
Example
This list, with Last modified set to the date 2024-05-01:
https://www.example.com/
https://www.example.com/search?q=keyboard&sort=price
www.example.com/about
produces the sitemap below. Line 3 is skipped with the message The URL is not an absolute URL; it must start with https:// or http://.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/</loc>
<lastmod>2024-05-01</lastmod>
</url>
<url>
<loc>https://www.example.com/search?q=keyboard&sort=price</loc>
<lastmod>2024-05-01</lastmod>
</url>
</urlset>
Common use cases
- Creating a sitemap for a small static website that has no sitemap plugin.
- Building a sitemap from a list of URLs exported from a crawler or spreadsheet.
- Checking a URL list for relative links, typos and duplicates before submitting it.
- Producing a sitemap for a set of new landing pages so search engines find them sooner.
Common errors and how to fix them
- No valid URLs found
- Every line must be an absolute URL including the scheme, such as https://example.com/page. Relative paths and bare domain names are rejected.
- A sitemap can list at most 50,000 URLs
- That is the limit set by the sitemap protocol. Split the list across several sitemap files and reference them from a sitemap index.
- Priority or change frequency is rejected
- Those fields accept only the values the protocol defines: a priority from 0.0 to 1.0, and a fixed set of frequency keywords. Google ignores both, so leaving them out entirely is a reasonable choice.
- Search Console says the sitemap could not be read
- Check that it is served from the same host and scheme as the URLs it lists, returns HTTP 200, and is sent as XML. A sitemap listing https URLs but served over http is a common cause.
Frequently asked questions
Which URLs are accepted?
Absolute URLs starting with https:// or http:// that have a host name and contain no spaces or # fragments. Relative paths such as /about, and addresses without the scheme such as www.example.com/about, are skipped and listed with their line numbers.
Why are & characters changed to &?
Sitemaps are XML, where & starts an entity. A URL such as ?q=keyboard&sort=price must be written as ?q=keyboard&sort=price inside <loc>. Search engines read it back as the original URL.
Should I set changefreq and priority?
They are optional. Google ignores both and uses lastmod only when it is consistently accurate. Other search engines may read them. Leave them unset unless you have a reason to use them.
How many URLs can one sitemap contain?
Up to 50,000 URLs and 50 MB uncompressed. The tool stops with a message above 50,000 URLs; split larger lists into several sitemaps and list them in a sitemap index file.
Why do I get a warning about different hosts?
A sitemap should only list URLs on the host where it is published, so https://shop.example.com/cart does not belong in the sitemap of www.example.com. The warning lists the lines whose host differs from the first URL.
Is my URL list uploaded to your server?
No. The sitemap is generated in your browser.