WordPress sitemap: where to find it when it returns 404 or there are several

A WordPress sitemap is an XML file listing the site's addresses. Without an SEO plugin it's at /wp-sitemap.xml; with Yoast SEO or Rank Math it's usually at /sitemap_index.xml. If it returns a 404 error, first save Settings → Permalinks without changes and clear the cache. If there are several sitemaps, keep the one from your active SEO plugin.

Author: The TellMyShop team. A guide for WordPress site and WooCommerce store owners: the cause, the manual fix and the same work in a chat conversation.
Last updated: · 6 min read

Where the sitemap is in WordPress

The sitemap address depends on what creates it. Since version 5.5 WordPress does it itself, as described in the announcement of XML sitemaps in WordPress 5.5. SEO plugins turn off the WordPress sitemap and provide their own.

What you have on the siteSitemap addressWhere you turn it on
WordPress alone, no SEO plugin/wp-sitemap.xmlworks on its own when the site is visible to search engines
Yoast SEO/sitemap_index.xmlYoast SEO settings, XML sitemaps feature
Rank Math/sitemap_index.xmlsitemap settings in Rank Math
Another sitemap pluginvaries, often /sitemap.xmlthat plugin's settings

The quickest way to check which sitemap you have: open yourdomain.com/robots.txt. WordPress and SEO plugins usually add a line with the sitemap address there.

The sitemap won't appear at all when “Discourage search engines from indexing this site” is ticked in Settings → Reading. It's a common leftover from when the site was being built. We cover it in more detail in the post on a page excluded by a noindex tag.

The sitemap returns 404: how to fix it

A 404 at the sitemap address means WordPress doesn't know what to show there. Before you start, make sure you're opening the right address from the table above. Then work through the steps in order, checking the sitemap after each one.

  1. Refresh the address rules. Go to Settings → Permalinks and click Save Changes without changing anything. It's the first piece of advice in Yoast's help on a sitemap giving a 404 error.
  2. Clear the cache. A caching plugin or your host may be holding on to an old 404 result. Rank Math also advises excluding the sitemap from the cache, as it explains in its article on the sitemap_index.xml 404 error.
  3. Turn the sitemap feature in your SEO plugin off and on. Save the settings after turning it off, then after turning it on. The plugin rebuilds the sitemap.
  4. Check the sitemap has something to show. A category sitemap with no published posts, or a sitemap for a content type turned off in settings, may return 404, and then everything is fine.
  5. Look for a conflict. A second sitemap plugin, or a theme with its own sitemap, may take over the same address. Check the plugin list.
  6. Ask your host about server rules. On Nginx servers and with unusual setups, the URL rewrite rules have to be added in the server configuration. That's a job for your host or whoever looks after the site.

When the 404 shows up on many addresses, not just the sitemap, the cause is wider. Read the guide on 404 errors on WordPress pages.

Several sitemaps at once: which to keep

Two sitemaps usually come from switching SEO plugins, moving the site or an extra sitemap plugin. Having two files doesn't harm you in Google by itself, but it causes confusion: in Search Console one sitemap has errors, the other doesn't, and you don't know which to trust.

The rule is simple: one sitemap, from the active SEO plugin. Turn off the sitemap feature in the extra plugin, and in Search Console remove the old sitemap and submit the current one. How to submit a sitemap and verify your site is in the guide on how to add a WordPress site to Google. The general rules for sitemaps, including the 50,000-address limit per file, are in Google's guide to building and submitting a sitemap.

What should and shouldn't be in the sitemap

The sitemap should point to the pages you want in Google. Look through it once after changes to the site:

  • Should be there: posts, important pages, categories with content, products in the store.
  • Shouldn't be there: noindex pages, redirected addresses, test pages, tag archives with a single post if you exclude them from results.
  • Watch the addresses: they should all start with https and use the same domain, with or without www, the way your site works.

How the chat checks your sitemap

The TellMyShop plugin for WordPress and WooCommerce opens the site's addresses the way a visitor does, so your chat (Claude or ChatGPT) checks the sitemap without you clicking anything.

You: Search Console says it can't fetch the sitemap. Find out what's going on.

Your chat: I checked the site. The active SEO plugin is Rank Math, and its sitemap /sitemap_index.xml returns a 404 error. robots.txt also still has a line with the old address /sitemap.xml, which returns 404 too. The caching plugin doesn't exclude the sitemap. The plan:

1. You: Settings → Permalinks, Save Changes without changing anything.

2. Excluding the sitemap from the cache, which needs the Plugins switch.

3. After the fix: remove the old sitemap in Search Console and submit /sitemap_index.xml.

You: I've saved the permalinks. Check again.

Your chat: The sitemap /sitemap_index.xml works. The cache is left: when you turn on the Plugins switch, I'll prepare a preview of the sitemap exclusion. I'll save it after your ‘yes’.

Illustration: products, numbers and replies are examples.

The addresses and results in this conversation are examples. In TellMyShop Free the chat opens the sitemap address and robots.txt, checks which SEO plugin is active and whether there's a second sitemap plugin, and then tells you what to fix. In TellMyShop Pro it also reviews plugin settings and makes fixes after your approval: SEO or caching plugin settings with the Plugins switch, which you turn on in the plugin panel for 24 hours, after a database backup from today. You can undo most changes from the change history.

What the chat won't do: submit the sitemap to Google, because it has no access to Search Console, or change the .htaccess file, which is blocked in every version. Server rules are fixed by your host. If the sitemap is only part of a wider visibility problem, start with the post on why a WordPress site isn't showing in Google.

More about the plugin is on the TellMyShop for WordPress and WooCommerce page, prices on the pricing page, and the free version on the TellMyShop Free page.

Questions and answers

Where is the sitemap in WordPress?

Without an SEO plugin, WordPress creates the sitemap itself at /wp-sitemap.xml. Yoast SEO and Rank Math turn it off and provide their own, usually at /sitemap_index.xml. You can also find the address that works on your site in the robots.txt file.

Why does the Yoast sitemap return a 404 error?

Most often because the address rules weren't refreshed after a settings change or a move. Saving the Settings → Permalinks screen without changes helps. If that doesn't work, the cause may be caching, another plugin or server rules that your host has to fix.

Can I have two sitemaps at once?

Technically yes, but it causes confusion. When Search Console has a sitemap submitted that no longer exists, Google reports a fetch error. Keep one sitemap, from the active SEO plugin, and remove the old one from Search Console.

If a page isn't in the sitemap, will Google not find it?

No. Google also finds pages through links. A sitemap helps, especially for a new site and lots of posts. Bear in mind that SEO plugins usually remove noindex pages from the sitemap themselves.

Can the chat submit the sitemap to Google?

No. The chat checks whether the sitemap works, what's in it and whether robots.txt points to the right address. You submit the sitemap yourself in Google Search Console, in the Sitemaps report.

WordPress is a trademark of the WordPress Foundation. WooCommerce is a trademark of Automattic Inc. Claude is a trademark of Anthropic PBC. ChatGPT and OpenAI are trademarks of OpenAI. TellMyShop is not affiliated with these companies.

TellMyShop for WordPress and WooCommerce

Your chat reads the site, shows every change before saving it and saves only after your yes. You can undo most changes with one sentence. Works with Claude or ChatGPT, free accounts included.

Read next