---
title: "WordPress Sitemap: Where It Is and How to Fix It"
url: https://hostmy.blog/wordpress-sitemap/
date: 2026-10-26
modified: 2026-10-26
lang: en
author: "Aditya Sharma"
description: "Where your WordPress sitemap lives, how to tell which one you have, what belongs in it, and how to fix the usual faults, with commands to check each one."
categories:
  - "WordPress"
image: https://hostmy.blog/wp-content/uploads/2026/10/hmb-card-2618-1024x538.jpg
word_count: 1382
---

# WordPress Sitemap: Where It Is and How to Fix It

A WordPress sitemap is an XML file that lists the pages you want search engines to know about. WordPress makes one for you, your SEO plugin probably makes another, and which one is in charge decides the address. When a sitemap breaks, the symptoms are quiet: pages are found slowly, Search Console reports an error, or the file loads and lists the wrong things.

This post covers where your sitemap is, how to tell which one you have, what should and should not be in it, and how to fix the usual faults. It is about the file and what it contains. How Google treats the pages in it is a separate question, and it comes up again below.

## Where the WordPress sitemap is

Since WordPress 5.5, core has served a sitemap at /wp-sitemap.xml. The WordPress core team's [announcement of it](https://make.wordpress.org/core/2020/07/22/new-xml-sitemaps-functionality-in-wordpress-5-5/) says that by default it covers public post types, public taxonomies, author archives and the homepage. In the comments on that post, a core developer adds that it is generated on request and not saved as a file, and that plugins such as Yoast SEO switch the core sitemap off in favour of their own.

That is the situation on most sites: a core sitemap that exists, and an SEO plugin that replaces it at a different address. On this site, SEOPress serves the sitemap at /sitemaps.xml, and requests for /wp-sitemap.xml, /sitemap.xml and /sitemap_index.xml all end up there. We checked it live, and the robots.txt names that address too.

| Who makes it | Address | Notes |
| ------------ | ------- | ----- |
| WordPress core | /wp-sitemap.xml | Generated on request, with up to 2,000 URLs per sitemap by default |
| Your SEO plugin | Set by the plugin | Usually replaces the core sitemap, so check the plugin's own settings |
| This site, with SEOPress | /sitemaps.xml | The other common addresses redirect to it |

## How to see which one you have

Do not assume. Ask the site. This loop requests the common addresses and prints where each one ends up, and the second command shows what your robots.txt says.

`for p in wp-sitemap.xml sitemap.xml sitemap_index.xml sitemaps.xml; do curl -s -o /dev/null -L -w "%{http_code} %{url_effective} $p\n" https://yourdomain.com/$p; done
curl -s https://yourdomain.com/robots.txt | grep -i sitemap`

If every address ends at the same file and returns 200, you have one sitemap. If two different files return 200, two things are generating them, and you should find out which one is yours. A single sitemap, named in robots.txt, is the aim. The file itself is explained in [our WordPress robots.txt guide](/wordpress-robots-txt/).

## What Google says about sitemaps

Google's [guide to building a sitemap](https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap) is plain. XML, RSS and text formats are all supported, and Google has no preference. A single sitemap is limited to 50MB uncompressed or 50,000 URLs, and larger sites split them and use an index file. Sitemaps should be UTF-8, and Google recommends the site root. You can tell Google about one through the Sitemaps report in Search Console, through the API, or with a Sitemap line in robots.txt.

The sentence that matters most is the one about what a sitemap does. Google calls a submission a hint, and says it may not download the file or use it for crawling. It also says to list the canonical URLs you want shown in results, written as full absolute addresses. A sitemap helps Google find pages. It does not make them be indexed.

## What should be in it

The rule is simple: every URL in the sitemap should be a page you want found, that returns 200, is not redirected, and is not marked noindex. Anything else sends a mixed message, because the sitemap says crawl this and the page says do not index it.

| URL type | Usually in the sitemap? | Why |
| -------- | ----------------------- | --- |
| Posts and pages | Yes | These are the content |
| Categories | Your call | Useful if each has its own text and purpose |
| Tags | Often no | Many tag pages are thin lists of the same posts |
| Author archives | Your call | On a one-author blog they can duplicate the posts list |
| Attachment pages | No | They rarely carry content of their own |
| Search results pages | Never | They are generated and endless |
| Redirected or noindex pages | Never | The sitemap should only list pages you want kept |

Core includes taxonomies and author archives by default, as the announcement says, so a site on the core sitemap may list pages it does not mean to. An SEO plugin lets you leave them out. Which choice is right depends on the site, and [best SEO plugin for WordPress](/best-seo-plugin-wordpress/) covers picking the plugin that makes the decision.

## The usual faults and the fixes

| Fault | What you see | What to do |
| ----- | ------------ | ---------- |
| The sitemap returns 404 | The address loads an error page | Check which plugin should be serving it, and save the permalink settings again so the rewrite rules refresh |
| Search engine visibility is set to discourage | The core sitemap is missing or returns a 404, and the page source has a noindex tag | Core switches its sitemap off while the Discourage search engines setting is on. Untick it in Settings, Reading when the site is ready to be found |
| The sitemap returns a 501 | A server error on a core sitemap | WordPress core needs the SimpleXML PHP extension, so ask the host to enable it |
| Two sitemaps | Different files at different addresses | Leave one in charge, and turn the other off |
| Redirected URLs listed | The sitemap names http or www addresses that redirect | Fix the site address setting, and regenerate |
| Noindex pages listed | Search Console flags a conflict | Remove the pages from the sitemap, or remove the noindex |
| Search Console cannot fetch it | The report says the file could not be read | Check robots.txt, the firewall and any security plugin |
| Staging URLs listed | The addresses name another domain | Correct the site address, then clear the plugin's cache |

The 501 detail comes from the core announcement, which says the SimpleXML PHP extension is required and that without it the server returns a 501. A redirect problem in the sitemap is usually a symptom of a wrong site address. The rest of that problem is covered in [choosing between a redirect plugin and a server rule](/wordpress-redirect-plugin-or-server-rule/).

## Count what is in it

Two commands tell you how big the sitemap is and whether the pages in it are healthy. If your sitemap is an index, as it is on this site, the first counts the sitemaps it lists and not the pages. The second reads one of those sitemaps and prints the status code for each of its first twenty addresses.

`curl -s https://yourdomain.com/sitemaps.xml | grep -o '<loc>' | wc -l
curl -s https://yourdomain.com/post-sitemap1.xml | grep -oE '<loc>[^<]+' | sed 's/<loc>//' | head -20 | while read u; do curl -s -o /dev/null -w "%{http_code} $u\n" "$u"; done`

Change the addresses to match yours, using a sitemap address listed in your own index file. Anything other than 200 in the second result is a page that should not be there, and it is worth fixing today. If you are in the middle of a move, the sitemap is one of the first things to check, and [the site migration SEO checklist](/site-migration-seo-checklist/) shows where it fits.

## Submit it, then leave it alone

Submit the sitemap once in Search Console, and make sure robots.txt names it. WordPress adds a reference to its core sitemap automatically, and SEO plugins normally add their own. Then stop resubmitting. A healthy sitemap needs no attention, and the time is better spent on the pages in it. If pages in the sitemap are not being indexed, that is not a sitemap fault, and it is the subject of the next post in this series.

The monthly habit is small. Open the sitemap report, check that the last read date is recent, and check that the number of discovered URLs is close to the number of pages you expect. A big gap either way is the signal. [What to actually monitor on a WordPress site](/wordpress-monitoring/) covers what else belongs on that monthly list.

Last checked in October 2026 against Google's sitemap guide and the WordPress 5.5 announcement. Sitemap behaviour depends on your plugins, so confirm with the commands above.

## Where Host My Blog fits

A sitemap is one of the quiet things that breaks without a message, which is the argument in [what breaks on a WordPress site when nobody is watching](/what-breaks-when-nobody-is-watching/). On the blogs we look after, the 404 and redirect review in a normal month would catch a sitemap that started listing bad addresses. If you would rather not be the one who notices, [our care for bloggers](/for-bloggers/) includes it.

If you opened your sitemap right now, would every address in it return a 200?