Sitemap Generator: How to Create and Submit an XML Sitemap

A sitemap is a list of the URLs you consider canonical and worth crawling. It does not make pages rank. What it does is shorten the gap between publishing something and having it discovered, which matters enormously on a new site, a large site, or any site where pages are not well linked internally.

This is the whole workflow, from collecting URLs to submitting the finished file. The Sitemap Generator handles the middle part; the judgement calls at either end are the ones worth getting right.

Step 1: gather the URLs

You need a complete list of the addresses on your site before you can decide which of them belong in the file. There are three routes, in descending order of reliability.

  • Your CMS. An export of published posts and pages is the most accurate starting point, because it reflects what actually exists rather than what happens to be linked.
  • An existing sitemap. If a plugin already generates one, point the fetcher at it. The tool reads the loc entries straight out of the XML, which gives you the current list to audit rather than rebuild.
  • A page on your site. Give the fetcher a page address and it returns the same-domain links on that page. Useful for a section index or an HTML sitemap; it reads one page and does not follow links further.

The fetch runs on our server rather than in your browser, because browsers refuse to read pages on other domains. The address you enter is used for the request and then discarded.

Step 2: prune, which is the part that matters

This is where most sitemaps go wrong, and it is the only step that needs your judgement. Every URL in the file is a statement that this address is canonical, indexable and worth a crawler’s time. Three tests, and a URL must pass all three.

  1. Does it return 200? No redirects, no 404s, no soft 404s.
  2. Is it the canonical version? If the page carries a rel=canonical pointing somewhere else, the other URL belongs in the file, not this one.
  3. Would you be happy to see it in search results? If it is noindexed, thin, or a filtered view of something else, it does not belong.

What that usually removes: paginated archives, tag pages, filtered and faceted URLs, internal search results, thank-you pages, and anything with a tracking parameter. If those are also burning your crawl budget, How to Stop Crawl Waste From Eating Your Rankings covers what to do about them at source.

A sitemap containing redirects and dead URLs is worse than no sitemap. It teaches Google that your list is unmaintained, and the file gets weighted accordingly.

Step 3: generate the file

Paste the pruned list one URL per line and press generate. If your list is relative paths rather than full addresses, set a base URL and the tool will expand them. Duplicates are removed automatically.

Three optional fields. Last modified is worth setting only if the date is true — Google uses lastmod where a site has proven it accurate and ignores it everywhere else, so a build date stamped across every URL is worse than nothing. Change frequency and priority are ignored by Google entirely; include them or do not, it changes nothing.

The output is escaped correctly, which matters more than it sounds. An unescaped ampersand in a query string is the most common cause of an invalid sitemap, and it fails silently — the file looks fine until a validator refuses it. If you are assembling URLs by hand, the URL Encoder and Decoder will show you what needs escaping.

If you want to understand what the generator is producing rather than just use it, How to Build an XML Sitemap by Hand walks through the format tag by tag.

Step 4: upload it to the right place

Download the file and put it in the root of your domain, so it answers at https://yoursite.com/sitemap.xml. Location is not cosmetic: a sitemap can only list URLs at or below its own directory, so a file in a subfolder cannot legally cover the rest of the site.

Two limits per file — 50,000 URLs and 50 MB uncompressed. Past either, split the list and reference the parts from a sitemap index. Splitting by content type is worth doing well below the limit anyway, because Search Console reports coverage per submitted file, which turns one vague number into several useful ones.

Check it loads in a browser before going further. A sitemap served with the wrong content type, or intercepted by a caching layer, will look perfect on your desktop and fail for crawlers.

Step 5: tell search engines it exists

Two things, both one-off. Submit the address in Google Search Console under Sitemaps, and add a Sitemap: line to your robots.txt so any crawler discovers it unprompted. The Robots.txt Generator has a field for it, and Robots.txt Generator: Writing Rules Crawlers Actually Follow covers the syntax around it.

Then leave it alone. Resubmitting an unchanged sitemap does nothing, and there is no mechanism by which submitting more often produces faster crawling.

Come back in a couple of weeks and read the coverage report against the file. The useful number is not how many URLs you submitted but how many were indexed, and the gap between the two is where the actual work is.

How often to regenerate

If a plugin maintains your sitemap, the answer is never — let it. Hand-built files suit sites that change slowly, and the honest cadence for those is whenever you add or remove pages, which for many sites means a few times a year.

The failure mode to watch for is a stale file that still lists pages you deleted six months ago. Point the fetcher at your own live sitemap occasionally and read the list. It takes two minutes and it is the cheapest audit available.

Keep reading

Scroll to Top