All fix guides
WarningIndexing & Sitemaps

How to Fix a Missing XML Sitemap

Your audit could not find an XML sitemap at the usual locations. A sitemap is a machine-readable file that lists the URLs you want search engines and AI crawlers to discover. Adding one, referencing it in robots.txt, and submitting it in Google Search Console helps crawlers find every important page faster and more reliably.

What this means

An XML sitemap is a file (usually at /sitemap.xml or /sitemap_index.xml) that lists the canonical URLs on your site, optionally with a last-modified date for each. It is a discovery aid: instead of relying only on crawlers following links from page to page, you hand them an explicit inventory of what you want indexed.

The "sitemap_not_found" flag means our crawler checked the standard locations and your robots.txt file and could not find a valid, reachable XML sitemap. That usually points to one of three causes: you never created one, it exists at a non-standard path that nothing references, or the file returns an error (404, 500, or a redirect) instead of valid XML.

This is a warning, not a critical error. Google can and does index sites with no sitemap by crawling links. But you are giving up a cheap, high-leverage signal, and on larger or newer sites the impact on discovery and indexing speed is real.

Why it matters

A sitemap does not guarantee indexing or boost rankings directly, but it makes discovery faster and more complete. New pages, deep pages with few internal links, and freshly updated content get found sooner because the crawler has an explicit list plus lastmod hints telling it what changed. On large sites, orphaned or weakly linked URLs may never be crawled without a sitemap pointing to them.

It also gives you a feedback loop. Once you submit a sitemap in Google Search Console, the Sitemaps report and Page Indexing report tell you how many submitted URLs are actually indexed versus excluded, and why. Without a sitemap you are flying blind on coverage.

For AI answer engines the logic is the same and often more pronounced. Crawlers behind ChatGPT, Perplexity, and Google's AI systems still rely on discovering and re-crawling your pages. A clean sitemap with accurate lastmod values helps them find your newest, most citable content and re-fetch pages you have updated, rather than serving a stale cached version. If you publish content you want cited in AI answers, do not make those pages hard to discover.

How to fix it

  1. 1

    Check whether one already exists

    Before creating anything, visit yourdomain.com/sitemap.xml and yourdomain.com/sitemap_index.xml in a browser. Also open yourdomain.com/robots.txt and look for a Sitemap: line. Many platforms and SEO plugins generate a sitemap automatically at a path our crawler did not check, in which case the real fix is just to reference it in robots.txt and submit it in Search Console. If the file loads but shows an error page or redirects, that is your problem to fix.

  2. 2

    Generate the sitemap (usually automatic on your platform)

    Most platforms create and maintain sitemaps for you. On WordPress, Yoast SEO and Rank Math both output a sitemap index at /sitemap_index.xml; confirm the feature is toggled on in the plugin's settings. Shopify auto-generates /sitemap.xml and per-type sub-sitemaps with no setup. Wix and Squarespace both generate /sitemap.xml automatically on published sites. For a hand-coded or headless site (Next.js, static HTML), you generate it yourself (see the code example).

  3. 3

    Keep it to canonical, indexable URLs only

    A sitemap should list one clean version of each page you want indexed: the canonical, self-referencing, 200-status, non-noindex URL. Exclude redirected URLs, pages blocked by robots.txt, noindex pages, parameter duplicates, and 404s. Listing junk URLs wastes crawl budget and can trigger 'Discovered/Crawled - currently not indexed' noise in Search Console. Use accurate <lastmod> dates so crawlers know what actually changed; do not reset every page's lastmod to the build date on every deploy.

  4. 4

    Reference the sitemap in robots.txt

    Add an absolute Sitemap: line to your robots.txt file so any crawler that reads robots.txt discovers your sitemap without a manual submission. This is how many AI and third-party crawlers find it. Example: Sitemap: https://yourdomain.com/sitemap.xml. You can list multiple Sitemap: lines. This directive is independent of any Allow/Disallow rules and can appear anywhere in the file.

  5. 5

    Submit it in Google Search Console

    In Search Console, open Indexing > Sitemaps, enter the path (e.g. sitemap.xml or sitemap_index.xml), and click Submit. Google fetches it and reports Success plus the number of discovered URLs. Check back in a few days: the Sitemaps report and Page Indexing report show how many submitted URLs got indexed and flag any that were excluded, which is your roadmap for the next round of fixes. If you use Bing, do the same in Bing Webmaster Tools.

  6. 6

    Re-run the audit to confirm

    Once the file is live at a standard path, referenced in robots.txt, and returning valid XML with a 200 status, re-run the audit. The sitemap_not_found flag should clear. If it still fails, confirm the URL is not behind a redirect chain, is not blocked by robots.txt, and returns a Content-Type of text/xml or application/xml rather than an HTML error page.

Example

<!-- FILE 1: sitemap.xml -->
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://yourdomain.com/</loc>
    <lastmod>2026-07-01</lastmod>
  </url>
  <url>
    <loc>https://yourdomain.com/blog/how-to-fix-sitemap</loc>
    <lastmod>2026-07-05</lastmod>
  </url>
</urlset>

<!-- FILE 2: sitemap_index.xml (use this instead when you have many pages;
     it points to child sitemaps rather than listing URLs directly) -->
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <sitemap>
    <loc>https://yourdomain.com/sitemap-posts.xml</loc>
    <lastmod>2026-07-05</lastmod>
  </sitemap>
  <sitemap>
    <loc>https://yourdomain.com/sitemap-pages.xml</loc>
    <lastmod>2026-07-01</lastmod>
  </sitemap>
</sitemapindex>

<!-- In robots.txt, point crawlers to it: -->
<!-- Sitemap: https://yourdomain.com/sitemap.xml -->

A minimal, valid sitemap.xml (first block) and a sitemap index for larger sites (second block). These are two separate files, not one. For Next.js you can generate the URL list automatically with an app/sitemap.ts file.

Platform-specific steps

WordPress (Yoast / Rank Math)

Both plugins generate a sitemap index automatically at /sitemap_index.xml. In Yoast, go to Yoast SEO > General > Features and confirm XML sitemaps is On. In Rank Math, go to Rank Math > Sitemap Settings and confirm it is enabled. WordPress core also ships a basic sitemap at /wp-sitemap.xml since version 5.5, but an SEO plugin's sitemap is more configurable. Run only one to avoid duplicates; the plugins disable the core sitemap by default.

Shopify

Shopify generates /sitemap.xml automatically with child sitemaps for products, collections, pages, and blogs. You cannot edit it manually. It includes only URLs on your primary domain and excludes hidden or password-protected content. Submit /sitemap.xml in Google Search Console. If you run multiple sales channels, make sure the storefront you care about is set as the primary domain.

Wix

Wix auto-generates /sitemap.xml once the site is published and connected to a custom domain. There is no manual editing, but you control which pages are included by toggling 'Show this page in search results' per page. Submit the sitemap URL from the Wix SEO dashboard or directly in Google Search Console.

Squarespace

Squarespace generates /sitemap.xml automatically for all published pages; you cannot edit it directly. Pages set to disable indexing (or password-protected) are excluded. Submit /sitemap.xml in Google Search Console under Indexing > Sitemaps.

Next.js / static HTML

For Next.js (App Router), add an app/sitemap.ts file that exports a default function returning an array of { url, lastModified } objects; Next serves it at /sitemap.xml automatically. For plain static sites, generate the XML at build time (a script or a package) and deploy it to the web root. Then add a Sitemap: line to robots.txt and submit it in Search Console.

Free tool
Check this with the Robots.txt Tester

Frequently asked

Do I really need an XML sitemap for a small site?

If your site is small (under a few hundred pages) and every page is reachable through internal links, Google will likely find everything without a sitemap. But a sitemap is nearly free to add, gives you the Sitemaps coverage report in Search Console, and helps AI and third-party crawlers discover pages via robots.txt. There is little downside, so add one anyway.

Where should the sitemap file live?

At the root of the domain it covers, most commonly https://yourdomain.com/sitemap.xml or a sitemap index at /sitemap_index.xml. A sitemap can only include URLs from the same host and protocol it is served under, so a sitemap at https://yourdomain.com/ should not list http:// URLs or URLs on a different subdomain. Reference the final path in robots.txt and Search Console.

What is the difference between a sitemap and a sitemap index?

A single sitemap file lists URLs directly and is capped at 50,000 URLs or 50MB uncompressed. A sitemap index is a parent file that points to multiple child sitemap files, which is how large sites and most SEO plugins organize things (one child sitemap per post type, for example). Submit the index in Search Console and it covers all the children.

Will adding a sitemap improve my rankings?

Not directly. A sitemap is a discovery tool, not a ranking factor. It helps crawlers find and re-crawl your pages faster and more completely, which can speed up indexing of new or updated content. Rankings still depend on content quality, relevance, links, and technical health.

How do AI crawlers like ChatGPT and Perplexity use my sitemap?

They use it the way search engines do: as a URL discovery and freshness signal. Referencing your sitemap in robots.txt is the most reliable way to expose it, since these crawlers fetch robots.txt. Accurate lastmod dates help them re-fetch updated pages instead of relying on a stale copy, which matters if you want your latest content cited in AI answers.

Does your site have this issue?

Run a free, AI-powered audit and we’ll flag this and 150+ other checks in about a minute. No signup.

No signup needed. Results in under 60 seconds.

Related fixes