Brand, websites, SEO & GEO and automations for small businesses.

WhatsApp
Guides

XML sitemaps: what they are and how to create one

What is an XML sitemap? The file indexing your pages for Google. File limits, crucial tags, generation on WordPress, Shopify or Webflow, and submission.

Unfolded paper floor plan on a white desk with blue lines connecting small squares

An XML sitemap is a structured text file hosted on your web server that lists all important URLs for search engines. It serves as an architectural roadmap designed specifically for search engine crawlers, not human visitors. While having a sitemap will not magically raise keyword positions, it helps Google discover your pages efficiently, particularly brand-new content and pages with few incoming internal links. Here is what an XML sitemap contains, when you need one, how to build it, and how to submit it to Google.

What an XML sitemap actually is

It is a file formatted in XML, typically placed in the root directory of your website, containing an inventory of canonical page addresses. XML is a markup syntax using tags, comparable to HTML, but intended for machine ingestion rather than visual browser display. A minimal XML sitemap looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourwebsite.com/</loc>
    <lastmod>2026-10-20</lastmod>
  </url>
  <url>
    <loc>https://yourwebsite.com/services/</loc>
    <lastmod>2026-09-02</lastmod>
  </url>
</urlset>

The underlying technical standard is defined on sitemaps.org. Three core rules apply:

  • The document opens with <urlset> and contains an individual <url> node for each page, requiring an absolute <loc> address.
  • Addresses must be fully qualified, including the correct protocol and domain name. Google crawls URLs strictly as declared, meaning https://yourwebsite.com/contact/ and http://yourwebsite.com/contact represent distinct endpoints.
  • The document must use UTF-8 character encoding, and reserved characters in URLs (such as & or ampersands) must be properly escaped.

A sitemap can only declare URLs located under the exact host and directory path where the sitemap file itself resides, which is why placing it at the domain root is standard practice.

Sitemaps, index files, and specialised formats

When your website exceeds standard thresholds (50,000 URLs or 50 MB per file), you create multiple sub-sitemaps and a parent index file that references them, submitting only the index URL to Google. This is the exact pattern employed automatically by WordPress and Shopify: a root index pointing to distinct sub-files grouped by post type.

The XML specification also supports specialised schemas: image sitemaps (referencing up to 1,000 media assets per URL, according to Google Search Central) and xhtml:link alternate annotations for multilingual websites. For a typical commercial SME operating in a single language, standard sitemap syntax is entirely sufficient.

Do you really need a sitemap for your website?

For a compact, well-structured website where every page is logically interlinked, Google states that a sitemap is not strictly required. For newly launched websites, large portals, or catalogues containing isolated deep pages, it is indispensable.

According to Google Search Central documentation, sitemaps are particularly valuable when a website is expansive, newly launched with few external inbound links, or rich in media assets. They are less critical when a site is relatively small, defined as around 500 pages or fewer, provided all essential landing pages are easily reachable through hierarchical navigation from the homepage.

Our view: deploy a clean sitemap regardless of site size. Your content management system likely produces one already, and it provides an invaluable diagnostic audit channel within Google Search Console. While a ten-page professional practice does not require a sitemap to get indexed, the day you publish a dedicated recruitment page without adding it to the main header, the sitemap ensures Google discovers it immediately. However, it never replaces strategic internal linking, the primary driver of page discovery.

Tags that matter and those Google completely ignores

Only two XML tags carry practical weight with Google: <loc>, which is mandatory, and <lastmod>, provided its date stamp reflects genuine content updates. The legacy tags <priority> and <changefreq> are disregarded.

TagPurposeGoogle position
locFull page URLMandatory, crawled exactly as written
lastmodDate of last modificationUsed only if consistently and verifiably accurate
changefreqAssumed update frequencyCompletely ignored
priorityRelative priority (0.0 to 1.0)Completely ignored

The critical tag requiring strict hygiene is lastmod. If your publishing platform refreshes the timestamp on every single URL whenever you save a minor site edit, search engine crawlers quickly stop trusting the signal. The date must change only when meaningful page copy or resources actually evolve, not when you adjust a footer comma. Following Google's retirement of its sitemap ping notification endpoint in early 2024, as reported by Search Engine Land, the lastmod attribute remains the primary programmatic mechanism to signal modified content. As for <priority>, save your effort: assigning 1.0 to your homepage and 0.8 to service pages has zero impact on Google rankings.

How to create your sitemap depending on your platform

In most modern environments, manual XML assembly is unnecessary: your underlying platform generates and refreshes the sitemap on autopilot. Your operational duty is simply verifying that the generated file exists and indexes valid, canonical pages.

WordPress

Since version 5.5 launched in 2020, core WordPress automatically generates an XML sitemap index located at /wp-sitemap.xml, documented by make.wordpress.org, and references it automatically in virtual robots.txt files. Popular SEO plugins (such as Yoast or Rank Math) typically override core functionality with their own index, commonly output at /sitemap_index.xml. Inspect both addresses in your browser, retain the active endpoint, and ensure duplicate generators are disabled so search engines receive a single source of truth.

Shopify

Shopify documentation confirms that every merchant storefront automatically generates a root sitemap.xml file, which references discrete child sitemaps for products, collections, standard pages, and editorial articles. This index refreshes automatically upon every catalog update. If your store operates across multiple international country domains, submit the respective sitemap for each distinct regional storefront.

Webflow

Within Webflow, automated sitemap generation is activated under Site Settings within the SEO tab, and regenerates on every site publication according to Webflow official guidance.

Custom coded websites

When operating a bespoke, engineered website, your sitemap should be compiled dynamically during the deployment build process directly from published content files. This is how Re:solve builds web applications: our build pipeline writes the XML sitemap using true filesystem modification histories. To evaluate platform trade-offs for your organisation, read our breakdown on WordPress, Webflow, Framer, or bespoke code: how to choose.

What to include in your sitemap, and what to keep out

An effective sitemap contains exclusively clean URLs that you actively want indexed in search results: canonical endpoints returning HTTP 200 status codes without noindex directives. The file exists to signal your priority assets; it loses diagnostic value when cluttered with:

  • URLs that return HTTP 301 redirects or 404 not found errors;
  • URLs tagged with a noindex robots meta directive, which sends contradictory signals to search crawlers;
  • Duplicate URLs (differing trailing slashes, tracking parameters, or sorting variants in an ecommerce catalogue);
  • Transactional utility pages such as order confirmations, checkout stages, user login screens, or staging drafts.

A frequent ecommerce issue occurs when automated sitemaps index thousands of faceted filter URLs (such as "blue dress size 10") that should never be indexed, obscuring indexing issues in Search Console. Having 80 pristine, indexable pages in a sitemap is far superior to having 500 messy URLs where half should be excluded.

During a site migration or redesign, your sitemap must contain only new target destinations. Deprecated legacy URLs belong in your redirect map, never in the new sitemap: see our complete guide to 301 redirects during a website redesign.

Submitting your sitemap to Google and verifying it

You have two complementary submission methods: submitting via the Sitemaps tool in Google Search Console, and declaring a Sitemap: directive inside your root robots.txt file.

Inside Search Console, the Sitemaps report allows webmasters to declare newly generated sitemaps, inspect crawl histories, and detect parsing errors. Paste your sitemap URL into "Add a new sitemap" and submit. The console displays operational status (Success, Couldn't fetch, or Errors) and the volume of discovered URLs. Google explicitly notes that discovering a URL carries no legal guarantee that the page will ultimately be crawled or indexed. If you are setting up monitoring for the first time, our Google Search Console beginner guide walks through this dashboard.

Declaring your sitemap inside robots.txt is equally straightforward. Google and other major search engines allow the directive anywhere within the file:

Sitemap: https://yourwebsite.com/sitemap.xml

This directive informs all compliant search robots, including Bing, without requiring separate accounts. Periodically open your live sitemap in a browser to ensure it resolves cleanly, and review Search Console monthly to compare discovered URLs against indexed counts. A growing divergence frequently indicates low-quality or duplicate pages in your feed. Our free website audit tool checks sitemap health, robots.txt syntax, and Core Web Vitals automatically.

Search engines and AI discovery systems like ChatGPT or Perplexity crawl web content in patterns similar to Googlebot: an accurate, structured sitemap with truthful dates offers a clean inventory of your newest material. At Re:solve, that technical hygiene forms the foundation of sustainable search visibility.

Frequently asked questions

Does an XML sitemap improve Google rankings directly?

No, an XML sitemap does not act as a direct ranking factor. It simply assists search engines in discovering your page architecture and identifying recent updates. Your ranking performance continues to rely on content authority, technical speed, and relevant backlinks.

Where should the sitemap file be located?

Place it at the domain root, such as https://yourwebsite.com/sitemap.xml, because a sitemap can only validate URLs situated within or beneath its own directory path. The actual filename is flexible, provided you declare the exact path within Google Search Console.

How often do you need to resubmit the sitemap?

Only once, provided your sitemap URL remains unchanged. Google re-reads the specified file periodically on its own schedule. Your ongoing responsibility is simply keeping the contents accurate with trustworthy timestamps.

Further reading

Start today.

We review your brand, website and online visibility, then set out your priorities.

Chat on WhatsApp