AI search, SEO & online discovery
Practical coverage from Dubai

Saved
Technical SEO

How to Build a Useful XML Sitemap for a Business Website

Summarize with AI
Website development and code review; illustrative photograph.
Photo by Pixabay / PexelsIllustrative photography
In this article 5 sections

A website owner opens the sitemap after a redesign and sees a long list of URLs. It includes service pages, old redirects and some pages the team never intended to surface in search. The file is valid XML, but the owner still needs to decide which entries belong and whether the search engine can read the published version.

Build the file from your maintained list of public pages. Check that listed URLs return the intended content and agree with the preferred canonicals. Then confirm the file can be fetched and processed in the relevant webmaster tool. The existing AI Visibility access checklist starts with whether crawlers can reach a site. This walkthrough uses the public sitemap to show how to verify the file and a sample of its entries. AI Visibility site access checklist · Google sitemap guidance

Decide which pages earn an entry

Start with pages the business maintains and wants eligible for search. A small site could have a homepage, services, branch pages, public articles and a contact page. If the same content is available under two addresses, list the preferred version. Compare the list with your publishing records rather than assuming that every URL generated by the application belongs in it. An unpublished preview or obsolete redirect may exist on the server without being part of the public content inventory.

A page’s intended status matters more than its route pattern. A query parameter used only to track a campaign can point to a clean canonical. A query parameter selecting a distinct archive page may represent content the publisher intends to keep discoverable. Check the response and canonical for representative examples. For a business that publishes in Arabic and English, determine which language versions have their own preferred URLs and include the versions you want discoverable. Review any alternate-language annotations separately. Google sitemap guidance

URL type Typical inventory decision Check before release
Public service or branch page Include the maintained canonical Response, content and preferred URL agree
Old address with a replacement List the current address Redirect leads to the correct replacement
Tracking variant of a public page List the preferred clean address Variant and clean URL have the intended relationship
Draft or intentionally excluded route Keep it outside the public sitemap Publishing and access controls match the intended state
Paginated or language-specific page Decide based on its content and policy Check the exact route, canonical and discovery purpose

For a site with a booking system on a separate host, define which team owns each origin and which pages belong in its file. Check the scope and any verified cross-site arrangement before putting another host’s URLs in a sitemap. Start with one maintained inventory per origin when that matches the site structure. Put a person or team in charge of what happens when a page is published, moved or retired. Sitemaps protocol · Google sitemap guidance

Generate the file from publishing decisions

Use the same data that determines what is published and which URL is preferred. A small static site can generate the list during its build. A CMS can generate it from public content types and indexing settings. Check what the platform produces after a real publish, canonical change or retirement. For example, Wix documents automatic sitemap updates and explains that changing a page’s default canonical can affect its sitemap inclusion. An official Wix reel embedded in coverage of a small-business website campaign illustrates the launch side of the work. The site’s generated file and support documentation are where the owner can check how pages enter the sitemap. Wix sitemap documentation · Coverage embedding the official Wix reel

Use absolute URLs and properly escaped XML. The protocol specifies UTF-8 and an XML namespace for the URL set. A simple file can contain just the listed locations. Where a query string contains an ampersand, serialize it through an XML library so it appears as an escaped character in the file. If you split the file, verify the sitemap index and the child files it names. The documented limit is 50,000 URLs or 50 MB uncompressed per sitemap. A small business can usually keep one file unless separate files make ownership or reporting clearer. Sitemaps protocol · Google sitemap guidance

Include lastmod where the publishing system can supply a reliable date of significant page changes. Google describes using the value when it is consistently accurate. A regenerated file may retain a valid previous date on entries whose pages did not change. If your system only knows when the sitemap was built, leaving the optional page date out keeps the file from suggesting that every page changed together. Google sitemap guidance

Consider a CMS with separate collections for services, branches and articles. A content editor publishes a branch page, but the sitemap generator only reads the article collection. The page can work in a browser and still be missing from the file. Compare the sitemap with a list exported from the publishing system, grouped by collection. Check one newly published URL and one intentionally excluded URL from each affected collection before changing the generator. This tells you whether the issue is one page’s settings or a collection-wide omission.

The reverse can happen when an entry is retired. If the generator reads a history table or caches its result, an old address can remain in the file while the public route already redirects. Check both the source list and the public file after the expected refresh. Retain enough information to identify whether the old entry came from the publishing data, generation step or delivered cache.

Fetch the live XML and test a sample of entries

Fetch the public file through the same address you intend to reference or submit. Save the response and body, note the final address and parse the XML. An HTML login page or generic error template can return a success status, so check the root element and namespace. Compare the number of unique locations with the inventory you expected. If the document is an index, repeat the checks for the relevant child files.

url='https://aivisibility.ae/sitemap.xml'
curl --silent --show-error --location --max-redirs 8 --max-time 20 \
  --dump-header sitemap.headers --output sitemap.xml \
  --write-out 'status=%{http_code} final=%{url_effective}\n' "$url"
python3 - <<'PYTHON'
from collections import Counter
from urllib.parse import urlsplit
from xml.etree import ElementTree as ET

ns = {"s": "http://www.sitemaps.org/schemas/sitemap/0.9"}
root = ET.parse("sitemap.xml").getroot()
assert root.tag == "{" + ns["s"] + "}urlset", root.tag
urls = [node.text for node in root.findall("s:url/s:loc", ns)]
print("entries", len(urls), "unique", len(set(urls)))
print("hosts", Counter(urlsplit(url).netloc for url in urls))
print("lastmod entries", len(root.findall("s:url/s:lastmod", ns)))
PYTHON

On 6 November 2026 at about 01:29 UTC, the AI Visibility sitemap returned HTTP 200 with an XML content type. The saved file parsed as a URL set with 42 entries, all unique and all on aivisibility.ae. It contained no lastmod entries. A separate public robots.txt capture from the same day named the sitemap URL. Those observations describe the published files, with no inference about submission status. AI Visibility XML sitemap · AI Visibility robots.txt

The sample included the homepage, technical SEO category, access checklist article and archive page at /?page=2. All four returned HTTP 200 without a redirect and declared themselves canonical in the initial HTML. The archive canonical matched in a clean Chrome DOM. This checks four entries, including one meaningful query-string URL. It leaves the remaining entries and the site’s index status outside the sample. Technical SEO category · Access checklist article · Second archive page

Expand your sample by page type before a release. Check the status and final address, confirm the page’s content and compare applicable canonical and robots directives. If one entry redirects, find whether the generator reads an older URL field than the page template. If a whole section goes missing, compare its publish and indexing settings with a section that still appears. When your site exposes a separate sitemap index, confirm the intended child file is referenced and can be fetched before diagnosing the individual page.

Submit and verify processing separately from indexing

List the file in robots.txt if that is part of your discovery setup. In an authorised Google Search Console property, submit the sitemap and record the address, status and last read date. Google’s Sitemaps report describes success as fetching and reading the file without errors. The report also explains that a sitemap discovered by other means may need to be submitted through the report or API to appear there. A robots.txt reference and a visible report row are distinct observations. Google Search Console Sitemaps report

Bing Webmaster Tools has a sitemap report with processing details and discovered URL counts. Use the appropriate verified property and check the returned messages. Treat the processing result as evidence about the file. Inspect a particular URL separately if the question is whether the engine indexed it. The public example in this walkthrough involved no submission and no access to a private webmaster property. Bing Webmaster Tools Sitemaps

If the file cannot be fetched, repeat a public GET and check the status, redirects and response body. If the tool reports XML errors, validate the actual deployed document and any referenced child. If processing succeeds but an important page is missing from the index, check the page’s HTTP response, robots directives and canonical, then use the appropriate inspection tool. Where you have permission to inspect edge or origin logs, verify the requester and record the time and response for that specific URL. A sitemap fetch and an individual page fetch answer different questions. Google Search Console Sitemaps report · Google requester verification guide

Keep the file tied to release checks

Use a Sitemap release record with the origin, public file address, owner, expected content types, entry count, sample checks and any submission status you can verify. Keep a copy before and after a redesign. A short diff can show newly included pages, removals and host changes. Compare these against the release plan before interpreting a change in count. A site may legitimately retire several duplicate URLs during consolidation.

Add a publish-and-retire check to routine maintenance. After publishing a new branch page, check that it appears under the intended address and can be found through relevant internal links. When a branch page moves, confirm that the sitemap lists the destination and the old address follows the approved redirect. If a branch closes and has no relevant replacement, record how the URL is handled and confirm the sitemap reflects that decision. Give the release owner a date for checking processing after the new file is available.

For a split sitemap, record the expected child file for each sample. If a category disappears, a correct root index alone cannot establish that the child file contains the expected pages. A maintainer should be able to find the relevant child, its generator and the person responsible for the URLs it lists.

AI Visibility is published by Lunasol, which offers GEO and AEO services. The worked example uses public XML, HTTP responses and one clean browser render. About AI Visibility

You’ve reached the end of this article. Read as plain text

Search the blog

Summarize with AI

Choose your assistant. Copy the article and summary request, then paste it into a new chat.

The full article is included, so your assistant can read it without opening this website. Nothing is submitted automatically.

View or copy the summary requestOpen assistant

Summaries are generated by your chosen service and may miss details. Its account requirements and terms apply.