If search engines can’t find your pages, those pages might as well not exist. An XML sitemap is one of the simplest tools in technical SEO, yet it’s frequently misconfigured, outdated, or missing entirely. This guide breaks down everything you need to know about XML sitemaps: what they are, how to build them, what to include, what to leave out, and how they support both traditional SEO optimization and AI-powered search visibility.
Key Takeaways
An XML sitemap is a structured sitemap file that lists your site’s URLs in a format designed to enable search engine crawlers to discover, crawl, and index content more efficiently. It acts as a roadmap for search engines, helping them find and understand website structure.
XML sitemaps are not mandatory. Google says a sitemap is most helpful for large sites, new sites with few external links, and sites with a lot of media, and that it does not guarantee everything listed will be crawled and indexed. You can generate one automatically with most CMS platforms, SEO plugins, or scripts.
You can automatically generate sitemaps using most content management systems, SEO plugins, or server-side scripts. For very small sites, you can manually create one with a text editor.
Always reference your sitemap in the robots.txt file and submit it via Google Search Console and other search engine submission interfaces to help discovery.
Including accurate optional metadata like <lastmod> and using multiple sitemap files with a sitemap index can help search engines stay up to date on your content changes.
What is an XML sitemap?
An XML sitemap is a file formatted in XML (Extensible Markup Language) that lists a website’s essential pages, along with structured metadata for search engines rather than human visitors. Sitemaps must be UTF-8 encoded and follow the sitemap protocol defined at sitemaps.org. XML sitemaps provide metadata about each URL listed, such as when it was last updated, helping search engines prioritize their work.
Search engines like Google and Bing use the sitemap as a roadmap to discover URLs that internal links or external links might miss. Pages buried deep in your site architecture, recently published content, or orphan pages with no inbound links all benefit. XML sitemaps help search engines discover pages that have few internal links or are newly published.
It’s worth clarifying the difference between “a sitemap” as a general concept (which could be an HTML page for users, a visual diagram, or even a text sitemap that lists one URL per line) and an “XML sitemap,” which is the specific format designed for search engine crawlers. There are also other sitemap formats like RSS and Atom feeds, but these provide only recent URLs rather than a comprehensive list of your site’s URLs.
At Nonofo Joel, XML sitemaps are a foundational element in every technical SEO audit and AI-Engine Optimization (AEO) project, because they reveal what search engines can see and what they’re missing.
How XML sitemaps help search engines (and AI search)
XML sitemaps support search engine crawling and search engine indexing by providing a clean, canonical list of preferred URLs. Instead of relying entirely on link discovery, crawlers can reference the sitemap to find important pages directly. Sitemaps can help search engines discover new content and pages that few links point to, though Google describes a sitemap as a hint, not a guarantee.
This matters for AI-powered search too. Google says pages must be indexed and eligible to be shown in Google Search with a snippet to appear as supporting links in AI Overviews and AI Mode, so basic discoverability still comes first. Other AI tools retrieve content in their own ways, which vary by product. Understanding how technical SEO affects AI search starts with making sure your pages are discoverable.
Google says it uses <lastmod> only if the values are consistently and verifiably accurate, so keep them honest. Quick discovery of new content matters most for time-sensitive material.
Consider three scenarios:
A frequently updated blog: New posts published weekly need rapid discovery. A sitemap can help crawlers find them without waiting for internal links to propagate.
A large e-commerce catalog: Thousands of product pages with variants. XML sitemaps can improve crawl efficiency for large websites by presenting canonical product URLs in one place.
A multilingual brand site: Content in multiple languages benefits from hreflang annotations within sitemaps, helping search engines serve the right version to the right audience.
For brands focused on AI visibility (AEO), a reliable sitemap is a practical step to help important pages be discovered by search systems. Learn more about optimizing content for answer engines.
Do you really need an XML sitemap?
Google says a sitemap is likely unnecessary for small sites (roughly 500 pages or fewer) with strong internal linking and little media content. Even then, a sitemap is harmless and is often generated automatically.
An XML sitemap is especially important when:
Your site is large, with deep page hierarchies
You maintain deep archives, such as a blog running since 2014, with archived URLs that rarely get linked to
Your domain is new and has few external links pointing to it
Your site uses complex faceted navigation generating many parameterized URLs
Sites that depend heavily on organic traffic, whether SaaS brands, content publishers, or B2B lead-gen sites, may want to maintain an XML sitemap. The cost is small, and it gives search engines another route to discover your pages.
In a typical technical SEO audit, Nonofo Joel evaluates the need for a sitemap by examining crawlability (server logs, crawl stats), index coverage (via Search Console data), and whether existing internal linking already surfaces all important pages. If gaps exist, the sitemap may be an early fix.
Core XML sitemap structure and required tags
A basic XML sitemap must include the XML declaration, a <urlset> root element with the sitemaps.org namespace, and one or more <url> entries. The <urlset> tag encapsulates the entire XML sitemap, and the <url> tag is required for each URL entry.
Inside each <url>, the <loc> tag is required and must contain the complete URL with the correct protocol (https) and host. You must use absolute URLs in your XML sitemaps, never a URL relative to the sitemap location. The sitemap file must be UTF-8 encoded, and all data values must be properly entity-escaped (e.g., & for ampersands).
Here’s a minimal example:
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://www.example.com/services/seo-audit</loc>
<lastmod>2026-10-15</lastmod>
</url>
</urlset>
Note the namespace declaration on the <urlset> element and the XML declaration that specifies the version and UTF-8 encoding. The protocol requires the <urlset>, <url>, and <loc> elements; all other tags are optional.
A single XML sitemap can contain up to 50,000 URLs. All URLs in a sitemap must belong to a single host. You cannot mix example.com and cdn.example.com in the same sitemap file.
Optional metadata: <lastmod>, <changefreq>, <priority>
XML sitemaps can include optional tags beyond the required <loc>, but modern search engines treat them differently. Sitemaps provide additional metadata about URLs, and sitemaps can include metadata indicating a page’s change frequency and relative importance.
The <lastmod> tag indicates the last modification date of a URL and is the most useful optional metadata. The last-modified date in XML sitemaps tells search engines when a page was last updated, using W3C Datetime format (e.g., 2026-10-15 or 2026-10-15T09:30:00+00:00). XML sitemaps can include metadata like last modified date to help crawlers prioritize which pages to revisit. Google says it uses this value to schedule crawls of URLs it has already discovered, as long as it consistently matches reality.
The <changefreq> and <priority> tags are ignored by Google. They represent the relative importance of a particular URL within your site, but search engines treat them as soft hints at best. Don’t rely on them for ranking or crawl priority.
Focus your effort on accurate <lastmod> values that reflect genuine content updates, not minor template tweaks.
For AEO purposes, an accurate modified date helps search systems notice when key thought-leadership pieces, case studies, or product pages are substantially refreshed.
Handling multiple sitemap files and sitemap index files
The sitemaps.org protocol sets strict limits: a single sitemap can hold up to 50,000 URLs and must be under 50 MB uncompressed. When your site exceeds either threshold, you need to create multiple sitemaps.
A sitemap index file is an XML file listing multiple sitemap files, allowing search engines to discover them efficiently. A sitemap index file can list up to 50,000 sitemaps, and sitemap index files must be no larger than 50 MB. Sitemap index files help manage multiple sitemaps for large websites.
Here’s a practical scenario: a mid-sized e-commerce brand might organize their sitemaps like this:
| Sitemap File | Content |
|---|---|
| /sitemap-pages.xml | Service and category pages |
| /sitemap-blog.xml | Blog posts and articles |
| /sitemap-products.xml | Product listings |
| /sitemap_index.xml | References all three sitemaps above |
Each individual sitemap in an index must contain URLs from a single host. You can also use gzip compression for large sitemaps and indexes to save bandwidth on your web server without affecting how search engines read them.
The sitemap protocol enables you to organize content logically, which makes monitoring in Search Console much easier.
Where to place your sitemap file and how to use robots.txt
The preferred sitemap location for most websites is at the root: https://www.example.com/sitemap.xml or a sitemap index like https://www.example.com/sitemap_index.xml. Placing it at the root maximizes coverage, meaning the sitemap file can list URLs from any path on the same site, including /blog/, /shop/, and /resources/.
Add a Sitemap: directive to your robots.txt file so crawlers automatically find it:
User-agent: *
Sitemap: https://www.example.com/sitemap_index.xml
This user agent line applies universally. You can list multiple sitemap files or a single sitemap index in the txt file.
For subdomains (e.g., shop.example.com), you’ll need separate sitemaps and robots.txt references per host. Each subdomain operates independently from a crawling perspective.
How to create an XML sitemap: CMS, tools, and manual methods
Most modern content management systems can automatically generate an XML sitemap. Here’s how the major platforms handle it:
WordPress: Core sitemaps arrived in version 5.5, exposed at /wp-sitemap.xml. Plugins like Yoast and RankMath extend this by creating separate sitemaps for posts, pages, and taxonomies, plus a sitemap index.
Shopify, Wix, Webflow, Squarespace: Google notes that CMS platforms such as WordPress, Wix, and Blogger may already provide a sitemap. Check your platform’s documentation to confirm whether it generates one and where it lives.
For small or custom-built sites with just a few dozen URLs, you can manually create an XML file using a text editor, following the standard structure outlined above. Every time you add or remove a page, update the file.
You can also use a third-party XML sitemap generator or server-side scripts (like cron jobs that pull URLs from a database) to generate sitemaps on a schedule. A text sitemap (a plain text file listing one URL per line) is another simple option, though it lacks the metadata capabilities of XML.
Nonofo Joel typically recommends automated sitemap generation integrated into the build or publishing process. This keeps technical SEO low-maintenance and ensures your sitemap stays current without manual intervention. Learn more about how to get your website indexed by Google once your sitemap is in place.
Which pages should (and should not) be in your XML sitemap?
Your sitemap should list URLs that you want to appear in search results and that offer clear value to users. Think: service pages, category pages, evergreen articles, product pages, case studies, and other pages that drive traffic or conversions.
Exclude the following:
Pages with noindex meta tags
Internal admin areas and staging environments
Thank-you pages and checkout steps
Duplicate filter or sort parameter URLs
Redirect URLs and broken links (404s)
Including only canonical URLs in a sitemap helps avoid duplicate URL signals that confuse search engines. Keep in mind that removing a URL from the sitemap does not guarantee deindexing. Search engines can still find URLs via other URLs, internal links, or external links.
Use robots meta tags (noindex) and, when appropriate, the robots.txt file to control what search engines are allowed to index.
Maintaining separate sitemaps for specific sections (blog, product, help center) keeps things organized and easier to monitor in Search Console. Each individual sitemap can then be tracked for processing errors independently.
Submitting your sitemap to search engines
After placing the sitemap on your web server, explicitly notify search engines rather than waiting for them to discover it. Creating and submitting an XML sitemap helps search engines discover and index website pages efficiently.
In Google Search Console, navigate to “Sitemaps,” enter your sitemap URL (e.g., sitemap_index.xml), and submit. The console will show:
Submission status
Number of discovered URLs
Any processing errors or warnings
Bing Webmaster Tools and other search engine submission interfaces accept sitemap URLs in a similar way. Sitemap index files allow efficient submission to search engines since you only need to submit one URL that references all your individual sitemaps.
Older HTTP “ping” style submissions (sending a GET request with the sitemap URL as a parameter) were deprecated by Google, which said in 2023 that the endpoint would stop working, so rely on robots.txt directives and console submissions instead.
Submitting an XML sitemap does not guarantee indexing or higher rankings. Google describes it as a hint, not a guarantee. Combine it with clean internal linking and a strong content strategy built around topic clusters.
Specialized sitemap types: images, videos, news, and international
Beyond standard page URLs, sitemaps can include extensions for rich media content and international targeting. XML sitemaps support specialized content like images and videos through dedicated XML tags.
Image sitemaps: Adding image-specific tags helps search engines discover assets in galleries, sliders, and lazy-loaded interfaces that basic crawling might miss.
Video sitemaps: Fields like video title, description, duration, and thumbnail URL help Google understand your videos. This is especially useful for video content embedded on product or tutorial pages.
Google News sitemaps: For approved publishers, these include stricter requirements and time windows for including recent URLs: Google says to include only articles created in the last two days.
Hreflang in sitemaps: You can include hreflang annotations to indicate language and regional variants (e.g., en-us, en-gb, fr-fr). Google says HTML tags, HTTP headers, and sitemaps are equivalent ways to signal language variants, and sitemaps can be the easiest to manage at scale.
These extensions help search engines discover and surface content that standard crawling alone would miss.
Common XML sitemap mistakes and how to troubleshoot them
Here are the most common errors that undermine sitemap effectiveness:
404 URLs in the sitemap: Listing pages that no longer exist wastes crawl budget.
Redirected URLs: Including 301/302 redirects instead of final destination URLs.
Non-canonical variations: Mixing http and https, or www and non-www versions.
URLs blocked by robots.txt: Creating a conflict between your sitemap and crawl rules.
Malformed XML: Encoding issues, unescaped special characters, or a missing namespace.
Exceeding limits: A single sitemap with more URLs than the 50,000 limit or larger than 50 MB.
Monitoring sitemap performance is important for optimizing search engine indexing. Use Google Search Console’s Sitemap report and Indexing reports to spot coverage gaps. Validate your sitemap against the official XML schema to catch structural issues. Run checks monthly or after major site changes.
During SEO or brand repositioning projects, Nonofo Joel reviews sitemap health alongside crawl logs and index coverage to align technical SEO with positioning strategy. Avoiding common SEO mistakes like these can save months of lost visibility.
XML sitemaps in a broader SEO and brand strategy
An XML sitemap does not improve rankings on its own. It supports the discovery and indexing of the web pages shaped by your brand strategy and content plan. Think of it as infrastructure, not a magic bullet.
Sitemaps work together with internal linking, topic clusters, and content hubs to signal website structure and authority to search engines. For example, a B2B brand building a thought-leadership library around “AI content optimization” can use a dedicated blog sitemap to ensure every cluster article is indexed and contributing to topical authority.
Consistent sitemap hygiene reduces friction when you’re repositioning a brand, migrating platforms, or consolidating multiple microsites into one domain. It’s one of those things that’s easy to set up and painful to fix later.
If you manage a small or mid-sized brand and aren’t sure whether your sitemap is helping or hurting your visibility, get in touch with Nonofo Joel for help auditing your technical SEO, sitemaps, and AEO readiness.
FAQ: XML sitemaps
Do XML sitemaps replace good internal linking?
No. Sitemaps complement, not replace, strong internal linking. Search engines still rely heavily on crawlable navigation and contextual links between other pages on your site. Pages that appear only in a sitemap but have no internal links pointing to them may get indexed, but they’re less likely to perform well in search results. A solid understanding of how search engines work makes this clear: crawling follows links, and sitemaps are a supplementary discovery mechanism.
How often should I update my XML sitemap?
Dynamic or automatically generated sitemaps update whenever new URLs are published or removed, which is ideal. If you manually maintain a sitemap file, update it whenever you add, remove, or significantly change important URLs. For active sites, this means updating often. Stale sitemaps with outdated <lastmod> values or removed pages may lead search engines to trust your sitemap data less.
Can I have more than one sitemap file for one website?
Yes. You can create multiple sitemaps, for example separate ones for pages, blog posts, and product listings, as long as each follows the protocol rules (50,000 URL limit per file, same host, UTF-8 encoding). A sitemap index file can then list all of these so search engines have just one URL entry point to discover everything.
Should I include noindex pages in my sitemap?
No. Including noindex URLs in your sitemap wastes crawl budget and sends conflicting signals. If a page must exist for user flows (like checkout steps), keep it noindex and simply exclude it from the sitemap while ensuring it still works for users.
Is a sitemap still useful if my site already has strong external links?
Absolutely. Even authoritative sites with many external links benefit from sitemaps, especially for deeper pages, seasonal sections, archived URLs, and newly launched content that hasn’t earned links yet. A sitemap is low-effort insurance for comprehensive discovery and indexing across your entire site, giving Google information about more URLs than it might find through links alone.
Sources
- Learn about sitemaps, Google Search Central
- Build and submit a sitemap, Google Search Central
- Sitemaps ping endpoint is going away; lastmod, Google Search Central Blog
- News sitemaps, Google Search Central
- Localized versions of your pages, Google Search Central
- AI features and your website, Google Search Central
- Sitemaps XML format, sitemaps.org
- New XML Sitemaps functionality in WordPress 5.5, WordPress Core blog