How crawlers find a sitemap
Google and Bing read Sitemap: lines in robots.txt, and you can submit a sitemap in Search Console or Bing Webmaster Tools. Many crawlers also try /sitemap.xml. A Sitemap: line is the one place every crawler looks, and it may point to any path, including a sitemap index.
Search Console says "Couldn't fetch"
In the Sitemaps report, Couldn't fetch means Google could not retrieve the sitemap file itself. Google's help page lists these causes:
- Wrong address: the sitemap returns 404 at the URL you submitted.
- robots.txt: a rule blocks Googlebot from the sitemap URL. Paste the sitemap path into the robots.txt tester to see which rule matches.
- Server errors: a 5xx or timeout. Google retries for a few days; for a temporary error you do not need to resubmit.
- Manual action: sitemaps are not read while a site has an unresolved manual action.
- Low crawl demand for the sitemap.
Run the check above first: it shows the HTTP status of every sitemap file and flags HTML or error pages served in their place. Then open URL Inspection in Search Console, enter the sitemap URL, click Live test and check that Page fetch says Successful. That test fetches as Googlebot, which a firewall may treat differently from our bot. Once it passes, resubmit the sitemap.
"Sitemap could not be read" and "General HTTP error"
Click the sitemap row in the Sitemaps report. Sitemap could not be read on the details page belongs to the same failed fetch as Couldn't fetch: the causes and the fix above apply. Google retries for a few days before it gives up.
General HTTP error means the download failed with an HTTP error that has no more specific message. Expand the error to see the code; it can be a plain 404. A 403 can come from a firewall or bot protection that blocks Googlebot but not your browser, so check it with the URL Inspection live test, not by opening the file yourself.
"Has errors": the file was read
Has errors means Google fetched the sitemap and still queued the valid URLs. These errors from Google's list are the ones that come up on live sites:
| Error in Search Console | Usual cause |
|---|---|
| Unsupported format | An HTML page at the sitemap address, or a wrong XML header or namespace. The check above flags HTML served as a sitemap. |
| Parsing error | Unescaped characters in a URL, most often a bare & that should be &. |
| Path mismatch: Missing www / Includes www | The sitemap sits on one host and lists URLs on the other. Move it or fix the listed URLs. |
| URL not allowed | Listed URLs on another domain or protocol, or above the sitemap's own folder. |
| Invalid URL in sitemap index file: incomplete URL | Relative paths in a sitemap index. Child sitemaps need full URLs. |
| Nested sitemap indexes | An index that lists another index. Google reads one level only. |
| Too many URLs | More than 50,000 URLs in one file. |
What makes a sitemap file unusable
- An HTML page or an error page served with HTTP 200 at the sitemap address, often from a CMS route that changed.
- A 404 or 5xx on a file that robots.txt or the index still lists.
- More than 50,000 URLs or 50 MB uncompressed in one file. Split it and list the parts in a sitemap index.
- URLs on another host or protocol, such as
http://URLs in the sitemap of anhttps://site, orwwwURLs on the bare domain.
Sitemap priority, changefreq and lastmod
Only <loc> is required in each <url> entry. The three optional tags are where most sitemap advice goes wrong:
| Tag | The protocol (sitemaps.org) | Bing | |
|---|---|---|---|
<priority> | 0.0 to 1.0, default 0.5, relative to other pages on the same site | Ignored | "Largely disregards" |
<changefreq> | always, hourly, daily, weekly, monthly, yearly, never | Ignored | "Largely disregards" |
<lastmod> | W3C Datetime, e.g. 2026-10-21 or with a time and time zone | Used, if it is "consistently and verifiably" accurate | Used to plan recrawls |
So setting every page to 1.0 or daily changes nothing. lastmod is the tag worth getting right: Google wants the date of the last significant change (main content, structured data or links), and says a new copyright year does not count. A plugin that stamps today's date on every URL at every build teaches Google to stop trusting the field.
Sources: Google's "Build and submit a sitemap" (updated 2026-07-08), Bing Webmaster blog "The Importance of Setting the lastmod Tag in Your Sitemap" (2023-02-01), sitemaps.org protocol.
Sitemap in Next.js
In the Next.js App Router you either put a static sitemap.xml in the root of app/, or add app/sitemap.js (or .ts) that returns an array of entries. Next.js serves it at /sitemap.xml. Each entry takes url plus the optional lastModified, changeFrequency, priority, alternates.languages (hreflang), images and videos:
The generated file is a Route Handler that Next.js caches by default, unless it uses a request-time API or a dynamic config option. A sitemap built from a CMS can lag behind it until that cache is refreshed. The traps, from the Next.js sitemap reference:
| Setup | What happens | What to do |
|---|---|---|
lastModified: new Date(), as in the examples in the Next.js docs | Every URL gets the time the sitemap was generated, not the time the page changed. Google uses lastmod only when it is consistently accurate (see the table above) | Use the page's real updated date from your CMS or database, or leave lastModified out |
generateSitemaps() in app/product/sitemap.js to split a big sitemap | The files are served at /product/sitemap/0.xml, /product/sitemap/1.xml and so on. The docs describe no sitemap index for them, so crawlers have to be told where they are | List each file in app/robots.js (its sitemap field takes a string or an array) or in your own sitemap index, and submit them in Search Console. Keep each file under 50,000 URLs |
A guide that shows /product/sitemap.xml/1 | That was the development URL from v13.3.2. Since v15 development and production use the same /product/sitemap/1.xml URLs | Submit the /sitemap/[id].xml form |
Next.js 16: const id = await props.id | Since v16 the id arrives as a promise of a string, so id + 1 gives "01", not 1 | Convert it first: Number(await props.id) |
Then enter your site in the checker at the top of this page. It reads the Sitemap: lines in robots.txt and /sitemap.xml, and shows each file it found, how it found it and how many URLs it lists.
Sources: Next.js "sitemap.xml" (updated 2026-08-18), "generateSitemaps" (updated 2026-09-28) and "robots.txt" (updated 2026-05-01) references.
Sitemap index files and sitemap_index.xml
A sitemap index is a sitemap of sitemaps. Each <sitemap> entry gives the full URL of one sitemap file, and you submit only the index. WordPress and the big SEO plugins all build one. Google's rules for index files:
- Up to 50,000
<loc>entries per index, and up to 500 index files per site in Search Console. - The listed sitemaps must be on the same site as the index, in the same folder or below it. An index at
/public/sitemap_index.xmlcan list/public/shared/sitemap1.xmlbut not/sitemap1.xml. - One level only: an index that lists another index is an error (see the table above).
<lastmod>is optional and gives the time the sitemap file changed, in W3C Datetime format.
Where WordPress puts the index:
| Setup | Index URL | URLs per child sitemap |
|---|---|---|
| WordPress core (5.5 and later, no SEO plugin) | /wp-sitemap.xml, also listed in WordPress's robots.txt | 2,000 by default |
| Yoast SEO | /sitemap_index.xml; /sitemap.xml should redirect there | 1,000 by default |
| Rank Math | /sitemap_index.xml | 200 is Rank Math's recommended setting |
WordPress turns its core sitemap off while Discourage search engines from indexing this site is ticked: one more reason to untick it after launch. If you submitted /sitemap.xml in Search Console and your plugin serves /sitemap_index.xml, submit the index URL.
sitemap_index.xml not found (404)
Rank Math's help sums it up: the index itself is missing, or one of the sitemaps it lists does not exist. Yoast's fixes, in order:
- Go to Settings > Permalinks and click Save Changes without changing anything. This rebuilds WordPress's rewrite rules.
- Check that the sitemaps are switched on in the plugin, and take post types or taxonomies with no published content out of the sitemap: an empty child sitemap returns 404.
- Open
example.com/?sitemap=1. If that loads and/sitemap_index.xmldoes not, the web server is not passing the pretty URL to WordPress. On NGINX, add Yoast's rules below; on other servers, or if you are not sure which one you run, ask your host.
The checker at the top of this page follows an index one level down (up to 20 sitemaps), shows the HTTP status of every file it lists and flags nested indexes, so a single 404 child shows up without opening each file.
Sources: Google's "Manage your sitemaps with sitemap index files" (updated 2025-12-10), WordPress core "New XML Sitemaps Functionality in WordPress 5.5", Yoast help "My sitemap is giving a 404 error" and "XML sitemaps on NGINX servers", Yoast XML sitemaps functional specification, Rank Math "How to Configure Sitemaps".
Sitemap not updating
You published a page and the sitemap still lists the old set, or Search Console shows a Last read date from weeks ago. The delay sits in one of three places, and each has its own fix:
| Where it is stuck | How to tell | What to do |
|---|---|---|
| A page cache or CDN in front of the site (cache plugin, host cache, Cloudflare) | The file you open is out of date. Yoast's tip: look at the sitemap's HTTP response headers (the X-Robots-Tag checker lists them all); if one mentions cache, a cache is serving it | Exclude the sitemap URLs from the cache plugin (WP Rocket: Never Cache URL(s); LiteSpeed: Do Not Cache URIs; WP Super Cache: Rejected URL Strings), add a Cloudflare rule that bypasses the cache for the sitemap URL, then purge. Hosts such as GoDaddy and WP Engine cache on their side: ask them |
| The SEO plugin's own sitemap cache | The file is stale even with page caching off | Rank Math: change Links Per Sitemap (for example from 200 to 201) and save, then Settings > Permalinks > Save Changes. To stop it caching, Rank Math gives the filter below. Yoast: its sitemap cache is off by default since version 9.0; to rebuild, switch XML sitemaps off, clear the cache and switch them on again |
| Google has not re-read the file | The file is current, but Last read in the Sitemaps report is old | Google re-reads a sitemap "at a pace unrelated to the regular site crawl". After a big change, resubmit it in the Sitemaps report: Google tries to crawl it right after submission. For a few new pages, Google says waiting is fine |
Plugins that still "ping Google" after every update do nothing there: Google shut the sitemap ping endpoint down six months after announcing it on 2023-06-26, and pings to it now get a 404. A Sitemap: line in robots.txt and the Search Console submission are the ways left. Run your site through the checker at the top of this page after any fix: it fetches the sitemap fresh and shows how many URLs each file lists, so a missing new page shows up at once.
Sources: Yoast help "Why the Yoast SEO sitemap does not update", Rank Math "How to Exclude Sitemaps from Caching", Search Console help "Manage your sitemaps using the Sitemaps report", Google Search Central blog "Sitemaps ping endpoint is going away" (2023-06-26).
Noindex pages in the sitemap
A sitemap asks Google to index a URL; a noindex tells it not to. Put a URL in both and Google obeys the noindex: the page stays out. Google's sitemap guide says to "include the URLs in your sitemap that you want to see in Google's search results", so a noindexed URL in the sitemap is either a page you want in Google that carries a noindex by mistake, or a page that should not be listed at all. Which one it is decides the fix:
| The noindexed URL is | What to do |
|---|---|
| A page you want in Google: a product, post or landing page | The noindex is the fault. Find where it comes from with the noindex checker (meta tag or X-Robots-Tag header), remove it, then ask Google to recrawl. Step by step: Excluded by 'noindex' tag |
| A page that should stay out: thank-you, cart, account, internal search, tag archives | Keep the noindex and take the URL out of the sitemap, usually in the settings of the plugin or code that builds it |
| A duplicate you noindexed so another URL ranks | Google advises against it: "We don't recommend using noindex to prevent selection of a canonical page within a single site, because it will completely block the page from Search." Point the duplicate to the main URL with a canonical link instead, and list only the main URL |
To find them in Search Console, open Pages, set the sitemap filter at the top to All submitted pages and look for Excluded by 'noindex' tag (Google's help calls it URL marked 'noindex'). Every URL in that list is in one of your submitted sitemaps and was noindexed when Google last crawled it. The Sitemaps report links to the same view for a single sitemap. Google's help names this as a cause of sudden error spikes: "you might have submitted a sitemap that includes URLs that are blocked for crawling by robots.txt, noindex, or a login requirement."
Outside Search Console, enter a page URL in the checker at the top of this page to see whether it is listed, and run the same URL through the noindex checker. Up to 10 URLs at a time: the bulk indexability checker.
Sources: Google's "Build and submit a sitemap" (updated 2026-07-08), "How to specify a canonical URL" (updated 2026-07-10), Search Console help for the Page indexing and Sitemaps reports.
Listed is not the same as indexed
A sitemap helps Google find and recrawl pages; it does not make them indexable. List only the canonical URL of each page, not redirects or noindexed pages. To see whether a listed page can actually be indexed, run it through the noindex checker.
We fetch robots.txt and up to 25 sitemap files, as NoindexWatchBot, for at most 20 seconds. Gzipped sitemaps are not read. Results are not stored.