An XML sitemap is a machine-readable file that lists the URLs of a website along with optional metadata about each page, giving search engines a structured map of the content you want crawled and indexed. To create one, gather the absolute URLs of the pages you want indexed, place one URL per line, optionally attach a shared lastmod, changefreq, or priority value, and export the result as sitemap.xml through the Lizely XML Sitemap Generator. The whole process runs in your browser and produces a file you can upload directly to your web server.

For most site owners, the hardest part is not writing XML but knowing which URLs deserve to be in the file. Crawling tools often return thousands of URLs, including thin tag pages, internal search results, and staging URLs that you would rather keep out of search engines. A curated list is usually faster to assemble and produces a cleaner sitemap, especially for small to mid-sized sites. This is exactly the workflow the Lizely generator supports: paste URLs, set optional fields, export.

how to create xml sitemap
how to create xml sitemap

What an XML Sitemap Actually Contains

The format is defined by the schema maintained at sitemaps.org, which is the canonical reference published jointly by Google, Bing, and others. At a minimum, every entry is wrapped in a <url> element with a required <loc> child holding the absolute page URL. Optional children include <lastmod> for the last modification date, <changefreq> for an expected update cadence, and <priority> for a relative hint between 0.0 and 1.0.

The root <urlset> element declares the XML namespace and a schema URL. A typical skeleton looks like:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url><loc>https://example.com/</loc></url>
</urlset>

Sitemaps have practical limits worth knowing about. A single file can contain at most 50,000 URLs and must not exceed 50 MB uncompressed. Larger sites split their URL set across multiple sitemap files and link them with a sitemap index file. Most small sites will never hit those caps, but it is good to keep them in mind as the site grows.

Choosing Between Crawling and Listing URLs

There are two general approaches to gathering URLs for a sitemap. The first is to crawl the live site with a bot that follows links and produces a URL list automatically. The second is to write down the URLs manually or export them from your content management system. Crawling is convenient but tends to surface low-value URLs alongside the ones you care about. Listing is slower but gives you editorial control over exactly what gets submitted.

ApproachBest forTrade-offs
Live crawl (e.g. Screaming Frog, Sitebulb)Large sites, audits, broken-link discoveryOften over-fetches; needs filters; may trigger server load
Curated URL list (e.g. CSV export from CMS)Small sites, landing-page-focused sitemaps, redesignsManual upkeep; easy to miss pages
Plugin-generated sitemap (e.g. WordPress plugins)Standard CMS sites that publish frequentlyHard to customize; may include unwanted URLs by default
Browser-based generator from a reviewed listSelective submissions, microsites, ad-hoc updatesYou maintain the list; no automatic refresh

If you already trust the URLs you want indexed, the curated approach pairs naturally with the Lizely generator. Paste the list, generate, and you are done. If your site changes weekly or has thousands of URLs, a plugin or crawler that re-runs on a schedule will save more time in the long run.

Building the Sitemap with the Lizely XML Sitemap Generator

This section walks through the exact steps for creating a sitemap.xml file from a reviewed list of page URLs, using the Lizely XML Sitemap Generator.

  1. Open the generator and locate the URL input area. Paste one absolute URL per line, making sure every line starts with either http:// or https://. The generator accepts a single host per file, so mixing www.example.com and blog.example.com on different ports is not supported in the same output.
  2. Decide whether you want a minimal loc-only sitemap or whether to attach optional metadata. Leave the optional fields blank for a clean <loc>-only file. If you choose to add lastmod, changefreq, or priority, the same value will be applied to every URL in the list, so use them truthfully. A shared "monthly" changefreq on a page that updates daily will mislead crawlers.
  3. Click generate. The tool will produce the full XML in a preview pane and show you a count of how many URLs were processed. Review the output visually to spot blank lines, malformed URLs, or duplicates before downloading.
  4. Download the resulting sitemap.xml file. The download happens entirely in your browser, so no URL data is transmitted to a server.
  5. Upload sitemap.xml to the root of the host you listed. For a site served from https://example.com/, the file should be reachable at https://example.com/sitemap.xml so crawlers can find it without authentication.
  6. Reference the sitemap in two places. Add a Sitemap: https://example.com/sitemap.xml line at the bottom of robots.txt, and submit the same URL through the search engine consoles (Google Search Console, Bing Webmaster Tools) for faster pickup.

How to Fill in Optional Fields Honestly

The optional metadata fields are often misused because they look like ranking signals. They are not. Crawlers use lastmod primarily as a hint for crawl scheduling, and changefreq and priority are widely described in the official documentation as hints that crawlers may ignore. That makes accuracy more important than precision.

For lastmod, use the date the page content was last meaningfully changed, formatted as W3C-datetime (for example, 2026-03-14 or 2026-03-14T09:00:00+00:00). The schema supports both a date-only and a full timestamp form. For changefreq, the allowed values per the schema are always, hourly, daily, weekly, monthly, yearly, and never. Picking a value that does not match reality tends to backfire, because crawlers compare it against what they actually observe.

For priority, the valid range is 0.0 to 1.0, with 0.5 as the default. Setting every page to 1.0 does nothing useful, since priority is relative within your own site. A reasonable pattern is to mark the homepage and main category pages slightly higher and leave article-level URLs at the default. If you skip the field entirely, that is also a valid choice and keeps the file lean.

Publishing and Validating the File

Once sitemap.xml is on your server, validate it before notifying crawlers. Search engines will report parse errors in their consoles, but it is faster to catch problems ahead of time. The reference schema at sitemaps.org/protocol.html describes every valid element and the namespace that must be declared on the root. Any deviation, such as a missing xmlns attribute or an unescaped ampersand in a URL, will cause the file to be rejected.

After upload, confirm the file is reachable by visiting it in a browser. You should see the raw XML rather than a download prompt, which signals the server is serving it with a text or XML content type. If your host serves it as application/octet-stream or forces a download, configure the MIME type or add a rewrite rule so crawlers can parse it on the fly.

Submit the sitemap URL through Google Search Console and Bing Webmaster Tools. Both tools show how many URLs were discovered, how many were indexed, and any errors. Treat the console reports as the source of truth for indexing status. The sitemap itself only signals which URLs you would like crawled; it does not guarantee inclusion in any search results.

Common Pitfalls and How to Avoid Them

A few mistakes come up repeatedly when site owners publish their first sitemap. Including non-canonical URLs is the most common. If a page is reachable at multiple URLs (for example, with and without a trailing slash, or with tracking parameters), pick the canonical version and list only that one. Otherwise crawlers see duplicate targets and may index the wrong variant.

Another frequent issue is listing redirected URLs. Once a page returns a 301 or 302, remove it from the sitemap and replace it with the final destination. Crawlers follow the redirect anyway, and a clean sitemap makes it easier to reason about which pages you actually consider important.

Finally, do not list pages blocked by robots.txt or marked noindex. The sitemap is a positive signal of pages you want crawled and indexed; sending crawlers to pages you have told them to avoid is contradictory and wastes crawl budget. If a page is intentionally excluded from search results, leave it out of the sitemap.

When to Refresh the Sitemap

A sitemap is not a one-time artifact. Any time you publish, delete, or significantly update a page that should be crawled, the sitemap should reflect that change. For sites with frequent publishing, regenerating the sitemap on each deploy is the simplest pattern. For smaller sites that change weekly or monthly, updating the list before submitting the new file is enough.

Two related workflows may help if you also manage campaign tracking or QR codes that point to those same URLs. Building campaign parameters with the Lizely UTM Link Builder keeps your tagged URLs consistent before they ever enter the sitemap list. And if you want visitors to reach the sitemap page from a printed asset, the Lizely QR Code Generator can encode the sitemap.xml URL into a downloadable image in the same browser-only style. These adjacent tools share the same privacy-first design, so the URLs you are working with stay local to your machine.

Once your sitemap process is routine, keep an eye on the indexing reports in Google Search Console. If the number of submitted URLs stays roughly equal to the number indexed over a few weeks, your list is in good shape. Large gaps usually point to canonicalization, redirect, or noindex conflicts that a sitemap review alone cannot fix.

Related guide: How to Create a Trackable UTM Link in Your Browser.