Skip to content
FunnelGuard

Fix guide by FunnelsGuard

Sitemap returns 404 or 5xx: how to find and fix it

SEO-102Medium impactOther toolBy FunnelGuardPublished Updated
On this page

What this issue is

An XML sitemap is a file that lists the pages you want search engines to find. It normally lives at /sitemap.xml or /sitemap_index.xml. When search engines request it, the server should answer with status 200 and XML content.

This issue means it answers with something else. A 404 says the file does not exist at that address. A 5xx (500, 502, 503, 504) says the server failed while building or serving it. Both leave crawlers with nothing to read.

What each status means for your sitemap
StatusMeaningCommon cause
404File not foundSitemap plugin off, permalinks not refreshed, wrong URL, file deleted in a migration
500Server errorPHP error, memory limit, plugin conflict, huge sitemap timing out
502 / 504Gateway or timeoutSlow sitemap generation behind a proxy or CDN
503Service unavailableOverloaded server, maintenance mode, rate limiting

Why it costs you leads or sales

Search engines can still find pages through links, so a broken sitemap rarely removes you from results overnight. The damage is slower. New landing pages, product pages and offers are discovered later, and updated pages are re-crawled less promptly. Search Console also shows the sitemap as failed, which hides useful indexing reports.

The risk is higher on large sites, new sites with few inbound links, and sites that publish often. If your campaigns send traffic to new pages that are not yet indexed, you lose organic leads for those pages in the meantime.

How a broken sitemap delays organic leads
  1. You publish a pageNew landing or product page goes live
  2. Crawler fetches sitemapGets a 404 or 5xx
  3. Page discoveredOnly if a link leads to it
  4. Page indexedDelayed
  5. Organic leadArrives later or not at all

The break is at the sitemap fetch; later steps happen slowly or not at all.

Days until a new page is indexedExample numbers
Days until a new page is indexed (example)Working sitemap: 3 days; Sitemap returns 404/5xx: 14 days0511314Working sitemapSitemap returns 404/5…days

Example: illustrative numbers only. Real timing varies by site and is never guaranteed.

How to check if your site has it

Check your sitemap status
  1. Open the sitemap in a browser

    Visit yourdomain.com/sitemap.xml, then /sitemap_index.xml (Yoast, Rank Math) and /wp-sitemap.xml (WordPress core). You should see XML or a list of child sitemaps, not an error page.

  2. Check the status code

    Run the curl command below. Look for HTTP 200 and a content-type containing xml.

  3. Read Search Console

    Go to Indexing > Sitemaps. A status of 'Couldn't fetch' or 'Has errors' with HTTP 404 or 5xx confirms the problem.

  4. Check robots.txt

    Open yourdomain.com/robots.txt and see which sitemap URL it lists. Make sure that exact URL works.

  5. Test as a crawler

    Request the sitemap with the Googlebot user agent. A firewall or security plugin may block bots while letting you through.

Check status code and content typebash
curl -sI https://www.example.com/sitemap.xml | head -n 10

# Follow redirects and show the final status
curl -sIL -o /dev/null -w "%{http_code} %{content_type} %{url_effective}\n" https://www.example.com/sitemap.xml

How to fix it

Work out first whether you have a 404 or a 5xx, then use the tab for your platform. The cause depends on how your site makes its sitemap.

Fix the sitemap by platform
  1. Refresh permalinks

    Go to Settings > Permalinks and click Save Changes without altering anything. This rewrites rules and often clears a 404 on sitemap URLs.

  2. Check the sitemap feature is on

    In Yoast SEO: Settings > Site features > XML sitemaps. In Rank Math: Sitemap Settings. Make sure only one plugin makes a sitemap.

  3. Look for a physical file

    An old static sitemap.xml in the site root can override the plugin and return stale or broken output. Delete it if a plugin handles your sitemap.

  4. Debug a 500

    Turn on WP_DEBUG_LOG in wp-config.php, reload the sitemap and read wp-content/debug.log. Deactivate plugins one by one to find a conflict, and raise the PHP memory limit if the log shows memory errors.

  5. Check caching and security plugins

    Exclude sitemap URLs from page caching, and make sure a firewall plugin is not blocking crawlers.

Nginx: make sure the sitemap is served as a filenginx
location = /sitemap.xml {
    try_files $uri =404;
    default_type application/xml;
}

How to confirm it's fixed

Confirmation checklist
  • The sitemap URL returns HTTP 200 in curl, with no long redirect chain.
  • The content type is XML and the file opens with a urlset or sitemapindex tag.
  • Every child sitemap in an index also returns 200.
  • robots.txt lists the working sitemap URL.
  • In Search Console > Indexing > Sitemaps, you resubmitted the sitemap and the status reads Success.
  • Bing Webmaster Tools shows the sitemap as processed.

Search Console may take a few hours or days to re-read the sitemap. If the status stays on an old error, resubmit it and check again later.

How to prevent it happening again

Prevention checklist
  • Re-test the sitemap after every migration, domain change, theme change and plugin update.
  • Keep only one tool generating your sitemap.
  • Exclude sitemap URLs from caching rules that could serve errors, and test them after changing CDN or firewall settings.
  • Add the sitemap URL to an uptime monitor that checks for status 200.
  • Check Search Console's Sitemaps report monthly, and turn on its email notifications.
How an unnoticed sitemap failure unfolds
  1. Day 0

    A plugin update or migration breaks /sitemap.xml. It returns 404.

  2. Week 1

    New pages are published. Crawlers fetch the sitemap and fail.

  3. Week 3

    Search Console shows 'Couldn't fetch'. Nobody reads the email.

  4. Week 6

    You notice new pages are not indexed and fix the sitemap.

How FunnelGuard handles this

FunnelGuard does not check sitemaps yet. A sitemap status check is a possible future addition, but today it is not part of the product.

What FunnelGuard does cover is the customer journey on your site: a robot visitor runs your lead forms, checkouts, and booking and chat buttons on a schedule, checks the tracking hits sent to ad and analytics platforms, and confirms test leads reach your inbox and CRM. That helps you find breakage that affects conversions once visitors arrive, but not whether search engines can read your sitemap.

To watch for sitemap errors yourself, use the Sitemaps report in Google Search Console and Bing Webmaster Tools with email notifications on, and add your sitemap URL to a general uptime monitor that expects a 200 status. You can also run the curl command above after each release. A free read-only FunnelGuard website audit is available if you want a wider look at your site.

A crawler asks for the sitemap and gets an error

The crawler requests the sitemap, the server answers with an error, and no page list is read.

Questions people ask

Why is my sitemap.xml returning a 404?

The file or route does not exist at that URL. Common causes are a sitemap plugin switched off, permalinks needing a refresh, a deleted file after a migration, or a redirect or rewrite rule catching the URL. Check which URL your platform actually uses, as it may be /sitemap_index.xml or /wp-sitemap.xml.

Why does Google Search Console say 'Couldn't fetch' for my sitemap?

Google requested the sitemap and could not read it. The usual reasons are a 404, a 5xx server error, a block by a firewall, or a redirect to a non-XML page. Open the URL yourself, check the status with curl, fix the cause and resubmit.

How do I fix a sitemap that returns a 500 error?

A 500 means the server failed while building the file. Read the error log, then look for a plugin conflict, a PHP memory limit or a timeout caused by a very large sitemap. On WordPress, enable WP_DEBUG_LOG and deactivate plugins one at a time.

Does a broken sitemap hurt my SEO rankings?

It does not directly lower rankings, but it can slow discovery and re-crawling of your pages. The effect is bigger for new, large or frequently updated sites. Pages with good internal links can still be found without it.

How do I fix sitemap_index.xml 404 on WordPress?

Go to Settings > Permalinks and click Save Changes to refresh the rewrite rules. Then confirm your SEO plugin has XML sitemaps enabled and that no other plugin or static sitemap.xml file is conflicting. Clear any page cache and test again.

How long until Google re-reads my sitemap after I fix it?

It can take from a few hours to a few days. Resubmit the sitemap in Search Console under Indexing > Sitemaps to prompt a new fetch. Do not delete and re-add it repeatedly.

Can a firewall or CDN cause my sitemap to return an error?

Yes. A security plugin, CDN rule or rate limit can return 403, 503 or a challenge page to crawlers while the sitemap loads fine for you. Test with a Googlebot user agent and allow legitimate search crawlers in your own settings.

Does FunnelGuard monitor my sitemap?

No. FunnelGuard does not check sitemaps yet; it runs your customer journeys such as forms and checkouts and checks tracking and lead delivery. For sitemaps, use Search Console, Bing Webmaster Tools or an uptime monitor.

Does FunnelGuard catch this?

Other tool

Needs a different kind of tool.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.