Skip to content

How to add and declare an XML sitemap

SEO2 min readFixes 5 checks sitemap-reachable, sitemap-urls-status, sitemap-valid-xml, sitemap-declared, sitemap-includes-page

A sitemap lists the URLs you want indexed and when they changed. Declare it in robots.txt so every crawler finds it.

Step by step, with screenshots: 'Discovered – currently not indexed': what it means and what to do →

Check your own site

Runs these 5 checks and the other 182, free, in about 45 seconds.

What a passing site looks like

  • XML sitemap is reachablewarning · −1.5 ptseffort M
  • Sitemap URL status: passeswarning · −1.5 ptseffort M
  • The XML sitemap follows the sitemaps.org protocolwarning · −1.5 ptseffort M
  • robots.txt declares a sitemapwarning · −1 ptseffort S
  • This page is listed in the sitemapinfo onlyeffort S

1. No working XML sitemap found

Why it matters. A sitemap lists every page you want indexed and when it changed. Without one, crawlers must find pages by following links, and deep or new pages can wait weeks.

How to fix it.
  1. Generate an XML sitemap and publish it at /sitemap.xml (most CMSs and SEO plugins do this automatically).
  2. Make sure it returns HTTP 200 and lists at least one URL; then declare it in robots.txt and submit it in Google Search Console.

2. Sitemap URL status

Why it matters. A sitemap should list only pages that answer 200. Redirects, 404s and noindex pages in it waste crawl budget and make Google trust the file less.

How to fix it.
  1. Remove deleted pages from the sitemap and list the final URL of redirected pages.
  2. Most CMS plugins do this automatically; if you generate the file yourself, rebuild it from the live URL list before publishing.

3. Sitemap format

Why it matters. Google reads a sitemap only when it is well-formed XML with absolute URLs and valid dates. One bad file means new pages are found late or not at all, and Search Console reports "couldn't fetch".

How to fix it.
  1. Regenerate the sitemap from your CMS or SEO plugin instead of editing it by hand, and validate it after every change.
  2. Use absolute https URLs in <loc>, dates as YYYY-MM-DD in <lastmod>, and split files above 50,000 URLs into a sitemap index.

4. robots.txt does not declare a sitemap

Why it matters. A "Sitemap:" line in robots.txt is how crawlers find your XML sitemap without you registering it anywhere. Without it, new pages are discovered later.

How to fix it.
  1. Add a line to robots.txt: Sitemap: https://your-site.com/sitemap.xml (use the full URL).

5. This page is not listed in the sitemap

Why it matters. Pages missing from the sitemap still get crawled through links, but Google finds updates to them more slowly and cannot use the lastmod hint.

How to fix it.
  1. Add the page to the sitemap, or check why the generator skips it (draft status, noindex, excluded post type).

Filed under Technical SEO. Copy is generated from the same catalogue that scores every report, so what you read here is what the report says.