How to Create a Sitemap for My Website

Short answer

Check whether you already have one before creating anything. WordPress core has published a sitemap at /wp-sitemap.xml since version 5.5, and Shopify, Wix, Squarespace and Webflow all generate one automatically. Building a static file by hand is the right answer only for a small site that rarely changes.

Run the Sitemap Generator

Crawl your site and get sitemap XML you can upload today.

Step one is not creating anything

The most common mistake here is generating a second sitemap when one already exists, which leaves two files disagreeing about which pages matter.

So look first. Read your own robots.txt for a Sitemap line, which is authoritative. Then try /sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml. Our sitemap checker does all of that in one go.

If you find one, your job is to check that it works and lists what you expect, not to replace it.

The three real options

Ranked by how well they age, which is the thing that matters most.

OptionBest forWeakness
Platform or plugin generatedAlmost everyoneLess control over what is included
Generated by your framework at buildCustom sitesNeeds a developer once
A static file you uploadSmall sites that rarely changeWrong the moment you publish anything

Why a static file is usually a trap

A sitemap you generate once is a snapshot. Publish a page tomorrow and it is already incomplete, and nobody remembers to regenerate it. Six months later it describes a site that no longer exists.

Worse, a stale sitemap is not neutral. It lists URLs that may now redirect or 404, and Google treats a sitemap as your own statement about which pages matter. Filling it with dead entries undermines that statement.

So use a one-off generator, including ours, for a genuinely static site, or as a way to see what a crawler can reach. For anything that gets updated, use something that regenerates itself.

After you have one

Two steps, and the second is usually skipped.

Add a Sitemap line to robots.txt pointing at the full absolute URL. That works for every crawler rather than only Google and takes one line.

Then submit it in Search Console, which is what gives you feedback: whether it was fetched, whether it parsed, and how many URLs were found. Google notes that submitting is a hint rather than a guarantee, so treat the Search Console view as a diagnostic rather than a lever.

Common questions

Do I already have a sitemap?+

Very likely. WordPress core has published one at /wp-sitemap.xml since 5.5, and Shopify, Wix, Squarespace and Webflow all generate one. Check your robots.txt for a Sitemap line first.

Should I build a static sitemap file?+

Only for a small site that rarely changes. A static file is out of date the moment you publish, and a stale sitemap listing dead URLs actively undermines its own purpose.

Where do I put the file?+

At your site root, so it resolves at yoursite.com/sitemap.xml. On many hosted platforms you cannot upload files at all, which is another reason to prefer the platform's own sitemap.

What do I do after creating one?+

Add a Sitemap line to robots.txt with the full absolute URL, then submit it in Search Console so you can see whether it was fetched and parsed.

Sources

A sitemap helps machines find your pages

It does nothing for the visitor who lands on one and cannot find what they came for. A Venbit agent reads your pages and answers them directly, by text or by voice. Free to start, no card.