# How to add and declare an XML sitemap

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

Technical SEO · HTML version: https://getreport.app/learn/xml-sitemaps

## XML sitemap

Passing looks like: XML sitemap is reachable.

**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.

## Sitemap URL status

Passing looks like: Sitemap URL status passes.

**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.

## Sitemap format

Passing looks like: The XML sitemap follows the sitemaps.org protocol.

**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.

## Sitemap in robots.txt

Passing looks like: robots.txt declares 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).

## Page listed in sitemap

Passing looks like: This page is 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).

Check your own page: https://getreport.app/
