Skip to content
SeenLens

XML sitemap missing: how to add one and submit it

An XML sitemap is a file that lists the URLs you want search engines to find. SeenLens warns when robots.txt declares no sitemap and /sitemap.xml does not answer. It reports info when the file does not list your page. Create the file, add a Sitemap line to robots.txt and submit it in Google Search Console and Bing Webmaster Tools.

By SeenLens · Last updated

Run the free 43-check scan on your page

What does the sitemap check read?

SeenLens reads the Sitemap: lines in robots.txt. When robots.txt has none, it tries /sitemap.xml. The check has weight 2 in the technical dimension and priority P2. Its evidence label is "Search engine guidance".

How the sitemap check scores a site
FindingResult
A sitemap answers 200 with XML and lists the page (the exact URL, or the URL without a trailing slash)Pass
A sitemap is reachable but the page is not in the part SeenLens readInfo
No sitemap is declared or reachableWarn
Every request was blocked with 403, 429, 503 or 202Not tested

SeenLens reads at most 3 sitemap files. A sitemap index counts as one file, and SeenLens follows at most 2 of its child files. It reads at most 5 MB per file, waits at most 10 seconds per file and reads at most 50,000 URLs in total. On a large site, the page may sit in a file that SeenLens did not read. That case gives info.

Why does a sitemap matter for AI search?

Google says search engines read a sitemap to crawl a site more efficiently. It helps most on a large site, on a new site with few external links, and on a site with many images or videos. Google says a site of about 500 pages or fewer that is well linked may not need one. Google also says a sitemap does not guarantee that URLs are crawled or indexed.

Bing wrote in July 2025 that sitemaps with accurate lastmod dates, together with IndexNow, help content get discovered and indexed. Bing adds that freshness signals affect how fast updates show in search results and in AI generated answers, and that no tool guarantees when content appears. SeenLens checks the sitemap because AI answers from Google and Bing draw on their indexes.

How do I add an XML sitemap?

Most CMSs and frameworks generate the file for you. If you write it by hand, follow these rules from Google and the sitemaps.org protocol:

  • Use UTF-8. A sitemap holds at most 50,000 URLs and at most 50 MB uncompressed. Split a larger list into several files and list them in a sitemap index.
  • Write fully qualified URLs, such as https://example.com/pricing. Relative paths are not valid.
  • List only canonical URLs that you want in search results. A sitemap can only cover URLs at or below its own path, so put the file at the site root.
  • Set lastmod to the real date the content changed, in ISO 8601 format. Bing advises against using the time the sitemap was generated, and says it ignores changefreq and priority.
sitemap.xml
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
  <url>
    <loc>https://example.com/</loc>
    <lastmod>2026-11-01</lastmod>
  </url>
  <url>
    <loc>https://example.com/pricing</loc>
    <lastmod>2026-10-20</lastmod>
  </url>
</urlset>
Next.js
// app/sitemap.ts (Next.js App Router, served at /sitemap.xml)
import type { MetadataRoute } from "next";

export default function sitemap(): MetadataRoute.Sitemap {
  return [
    { url: "https://example.com/", lastModified: new Date("2026-11-01") },
    { url: "https://example.com/pricing", lastModified: new Date("2026-10-20") },
  ];
}

How do I declare the sitemap in robots.txt?

Add one Sitemap: line per sitemap file to robots.txt. Google says the rule is optional, allows more than one line and needs a fully qualified URL. Google does not guess the http or https and www variants, so write the exact address. The line can sit anywhere in the file.

robots.txt
User-agent: *
Allow: /

Sitemap: https://example.com/sitemap.xml

Do not disallow the sitemap path. If your site has no robots.txt yet, see robots.txt missing. For the rules AI crawlers read, see robots.txt for AI crawlers.

How do I submit and verify the sitemap?

Request the file first. It must answer 200 with XML.

curl
curl -sI https://example.com/sitemap.xml | head -n 5
  1. Google Search Console. Open the property, then the Sitemaps report. Google advises a live URL inspection of the sitemap URL first, with "Page fetch" showing "Successful". Paste the sitemap URL under "Add a new sitemap" and select Submit.
  2. Read the status. "Success" means Google read the file with no errors. "Has errors" means some URLs have problems. "Couldn't fetch" means Google could not get the file, often because of a robots.txt block, a 404 or a server error. The "Discovered pages" column counts the URLs read from the file.
  3. Bing Webmaster Tools. Submit the sitemap in the tool, then open the Sitemaps section for your verified site to check it. Bing also finds a sitemap through the robots.txt line.
  4. Scan again. Run the SeenLens scan on a page that the sitemap lists. The check passes when the file answers 200 with XML and lists the page.

Scan your page with SeenLens

When can I ignore this check?

A small site with strong internal links can do well without a sitemap, as Google says. Fix blocked crawlers, missing titles and noindex rules before this check.

Does a sitemap get my pages indexed?

No. Google says a sitemap does not guarantee that URLs are crawled or indexed. It helps discovery. Google's Page indexing report shows the result per sitemap.

Sources