How to create an XML sitemap
- Paste the full URLs of the pages you want search engines to find, one per line. Include
https://. - Choose whether to include a last-modified date, change frequency and priority.
- Download the file as
sitemap.xmland upload it to your website’s root folder. - Submit
https://yourdomain.com/sitemap.xmlin Google Search Console (Sitemaps report) and Bing Webmaster Tools, and add aSitemap:line to your robots.txt.
The generator removes duplicates, warns about invalid lines and URLs from different domains, and escapes special characters such as & as the XML standard requires.
What is an XML sitemap?
An XML sitemap is a file that lists the important URLs on your site so search engines can discover them, especially pages that are new, deep in the site structure, or not well linked. It follows the protocol published at sitemaps.org and supported by Google, Bing and others.
Sitemap tags explained
| Tag | Required? | Notes |
|---|---|---|
<loc> | Yes | The full, canonical URL of the page |
<lastmod> | Optional | Google uses it if it is consistently accurate — update it only when content really changes |
<changefreq> | Optional | Ignored by Google |
<priority> | Optional | Ignored by Google; some other engines may read it |
Sitemap best practices
- Include only canonical, indexable pages that return status 200 — no redirects, 404s, noindex pages or duplicates.
- A single sitemap can hold up to 50,000 URLs and 50 MB uncompressed. Larger sites use several sitemaps and a sitemap index.
- Use the same version of every URL that your site links to (https, with or without www, trailing slash).
- Most CMSs generate sitemaps automatically — WordPress has a built-in sitemap at
/wp-sitemap.xml, and SEO plugins create their own. Use this tool for static sites and custom builds.
A sitemap helps discovery, but it does not guarantee indexing. Google indexes pages based on their quality and usefulness.
Frequently asked questions
Where do I upload sitemap.xml?
To the root folder of your site, so it opens at https://yourdomain.com/sitemap.xml. Then submit it in Google Search Console.
How many URLs can a sitemap contain?
Up to 50,000 URLs and 50 MB uncompressed per file. Use a sitemap index for larger sites.
Does Google use priority and changefreq?
No. Google ignores both and uses lastmod only when it is accurate.
Do I need a sitemap for a small site?
Not strictly, if all pages are well linked. But a sitemap is easy to make and helps new sites get discovered faster.