How to Create XML and HTML Sitemaps: URL Selection, Submission, and Checks
August 5, 2026
Author: Shusaku Yosa
Create an XML sitemap to describe eligible URLs to search engines and an HTML sitemap to help people find pages. Decide which canonical URLs belong in the file before choosing a generator. Successful submission is a useful operational check, but it is not proof that every listed page has been indexed.
Choose XML or HTML sitemaps for the right purpose
An XML sitemap is a machine-readable list that can help search engines discover pages. An HTML sitemap is an ordinary page organized for visitors. They solve different problems, so producing both is not an automatic requirement for every website.
A small site with clear links between its pages may not need an XML sitemap. Google’s sitemap overview describes situations where one can be especially useful, including larger or newer sites. A sitemap supports discovery; it does not replace accessible pages, useful content, or relevant internal links.
Type | Primary purpose | Design question |
|---|---|---|
XML | Describe eligible URLs to search engines | Can the file reflect current canonical URLs? |
HTML | Help visitors navigate | Can someone find a page by task or topic? |
Select canonical URLs and exclude redirect sources
List the canonical URLs that you want indexed. Normally these are final public URLs that return the intended content with a 200 response. Exclude redirect sources, removed pages, noindex pages, and unnecessary duplicate versions. Do not exclude a redirect destination merely because another URL redirects to it.
In a fictional example, /old-guide permanently redirects to /guide. Include /guide if it is the intended canonical page; remove /old-guide from the sitemap. If both versions must remain accessible, align internal links, sitemap entries, and the canonical preference. Google’s canonicalization guidance explains that these methods provide signals. They do not force Google to accept a particular canonical.
Choose CMS generation or a small manual file
For a frequently updated site, first inspect the sitemap generated by the CMS. Check whether it excludes inappropriate URLs and changes when pages are published, removed, or redirected. Avoid enabling several overlapping generators without understanding which file is authoritative.
A small manual file can work when someone can maintain it reliably after every change. A crawler-generated list is an input to review, not an instruction to publish every discovered URL. Search-result pages, administration paths, and unnecessary parameters may need to be excluded. Check the selected product’s current features and limits rather than assuming that any generator is free or unlimited.
Check required fields, lastmod, and file limits
Google’s sitemap-building documentation shows the required XML structure: a urlset with the sitemap namespace, containing a url element for each page and an absolute URL in loc. Use the documented encoding and XML escaping. Include lastmod only when it accurately reflects a significant update. Changing every date to today on every generation does not create a reliable update record.
Google ignores priority and changefreq. Do not treat their values as ranking controls or instructions that guarantee crawl priority. The following fictional two-page example specifies the required loc values. Each row represents one url element inside the documented urlset wrapper; replace the example URLs with your own absolute canonical URLs.
Entry | Required loc value | Optional lastmod |
|---|---|---|
1 | Use a verified significant modification date, or omit | |
2 | Use a verified significant modification date, or omit |
A sitemap file is limited to 50,000 URLs or 50MB uncompressed. Split it if either limit is exceeded, and use a sitemap index to organize the resulting files. A small compressed file is not evidence that its uncompressed size is within the limit.
Validate file access, syntax, and included URLs
Open the published sitemap URL and verify that it returns the intended XML rather than a sign-in screen or error document. File access, XML syntax, and URL selection are separate checks. Compare the generated file with the publication inventory so that missing pages and unwanted entries can be identified.
- Check the HTTP response and the actual file contents.
- Confirm that loc values use the intended host, language, and absolute URL.
- Check listed pages for response status, canonical preference, and indexing controls.
- Test an addition, removal, and redirect against the generation rules.
Passing these checks establishes file consistency. It does not establish content quality or guarantee indexing. Keep useful navigation links in place so discovery does not depend on one file.
Separate submission status from URL indexing
Submit the sitemap URL through Search Console and review whether Google could fetch and process it. You can also identify the sitemap location in robots.txt. The official Sitemaps report documentation distinguishes processing information from the later indexing of individual pages.
Keep submission, file retrieval, URL discovery, page crawling, indexing, and search appearance separate. Inspect important URLs individually where needed. A discovered-but-not-indexed result is different from crawled-but-not-indexed. A missing row in a search-performance report is also insufficient evidence of non-indexing. Record the observed state instead of collapsing all these outcomes into a single success label.
Design an HTML sitemap around user tasks
Organize an HTML sitemap around the way visitors look for information. A fictional business-service site might group its overview, pricing, and implementation guide under “Evaluate the service,” while placing help articles and contact details under “Get support.” This is a navigation pattern, not a required commercial structure.
Use descriptive link labels and keep important pages reachable through normal navigation as well. Google’s guidance on crawlable links helps with the technical checks. If the list becomes difficult to scan, split it into meaningful category pages rather than creating an enormous unstructured directory.
Maintain a record of additions, removals, and redirects
Automation still needs an owner. Keep a record of changes so that an obsolete URL reappearing in the file can be traced to a generation rule or publication error. The first row below is fictional; the second is a worksheet.
Change and URL | Sitemap decision | Owner, date, evidence |
|---|---|---|
/old-guide redirects to /guide | Exclude the old source; include the canonical 200 destination | Owner A; enter date; response and generated XML |
________ | Add, remove, or redirect: ________ | Owner: ____ Date: ____ Evidence: ____ |
After a change, check representative pages as well as the file. Record submission status, URL inspection, and search appearance separately. This keeps a clean operational record without suggesting that maintaining a sitemap guarantees rankings.
Continue with the guide that matches your next task: SEO-Friendly URL Design: Naming, Parameters, and Migration Checks; Page Speed and Core Web Vitals: Measure Experience and Evaluate Improvements; SEO for Beginners: Check, Plan, Publish, and Improve Your Website; Mirror Sites and Duplicate Content: Assess Ownership, Canonicals, and Copying.


