Skip to content

WordPress wp-sitemap.xml returns 404? Find the owner

Diagnose a missing WordPress core sitemap by checking site visibility, plugin replacement, rewrite routing, and the exact sitemap advertised in robots.txt.

By Crawlito · 5 min read

In short

  • WordPress core sitemap availability depends on site visibility and the wp_sitemaps_enabled filter.
  • An SEO plugin can intentionally replace the core sitemap with its own endpoint.
  • A missing core URL needs to be assessed alongside the maintained public sitemap.
On this page

When /wp-sitemap.xml returns 404, first check whether WordPress core or an SEO plugin owns the site's sitemap. Then inspect public site visibility, the wp_sitemaps_enabled filter, and routing for the exact URL. A core endpoint can be intentionally disabled while a different maintained sitemap supplies the publication's URLs. WordPress’s sitemap enablement implementation

Find the sitemap the public site advertises

Fetch robots.txt from the production hostname and follow its Sitemap lines. Compare those addresses with the sitemap submitted in Search Console and the generator configured in WordPress. Common installations can expose a core index, a plugin index, or an older static file. The existence of several familiar filenames does not establish which is authoritative for this site.

Open each advertised endpoint anonymously and inspect the actual response. A CMS error page can return success, while a sitemap route may redirect to a plugin's replacement. Save the status, final URL, root XML element, and a sample current page. The sitemap fetch guide helps distinguish retrieval failures from malformed XML.

Ask whether the failed core URL is still referenced anywhere under the publisher's control. If the site has intentionally migrated to another generator, correct obsolete declarations and submissions through the normal workflow. Re-enabling a second generator solely to make a remembered URL work can introduce another independent source of sitemap data to maintain.

Inspect visibility before changing it

WordPress's core sitemap enablement starts with the site's blog_public setting and applies the wp_sitemaps_enabled filter. Check those values in the environment serving the public site. A staging configuration copied during migration can unintentionally affect production visibility.

For a site you administer through WP-CLI, read the site identity and public-visibility option in the appropriate installation context.

bash
wp option get home
wp option get blog_public

Interpret the result with the site's intended access and indexing policy. A private or prelaunch site may deliberately discourage indexing. Changing visibility can affect more than the sitemap, so verify the publication's actual launch state before making that change. The staging exclusion guide explains how to test the broader public output.

Inspect the page's robots metadata and headers too. A sitemap restored while all articles still carry an unintended noindex directive leaves the larger publishing problem unresolved. Conversely, a sitemap 404 caused by a plugin replacement does not justify changing a correct page-level policy.

Locate filters and replacement generators

Review active SEO plugins, must-use plugins, custom theme code, and hosting integrations for sitemap ownership. WordPress provides a filter that can disable core sitemap output. A plugin may use it intentionally when supplying its own sitemap. Read the extension's current documentation and inspect its generated endpoint before deciding the filter is a defect.

Search the code your team maintains for wp_sitemaps_enabled and for custom sitemap routes. Keep the scope narrow and avoid changing installed dependencies just to make a diagnostic experiment. A test in staging can disable a suspected component temporarily under the site's established workflow while preserving a reproducible baseline.

ObservationNext place to check
Core endpoint fails, plugin sitemap worksIntended generator ownership
Both fail and pages are discouraged from indexingVisibility or copied environment settings
Plugin disabled, old sitemap declaration remainsRobots output and Search Console submission
Only public host failsProxy, CDN, or web-server routing
Correct XML lacks new recordsProvider query or sitemap cache

Read the final response rather than relying on a plugin's “enabled” switch. A switch can be stored correctly while an upstream rewrite intercepts the path. The WordPress robots file guide illustrates the similar problem of a public endpoint being served by a different layer from the one an editor changed.

Check routing and cached errors

A WordPress sitemap route depends on the site's routing and rewrite behavior. Compare the production endpoint with a representative ordinary permalink and any diagnostics supported by your hosting setup. If a migration changed the web root or reverse proxy, ensure the request reaches the intended WordPress installation.

Review rewrite changes with the person responsible for the server. Refreshing permalink rules through the normal WordPress workflow may be appropriate after a known route change, but it cannot fix an edge rule that returns an error before WordPress runs. Capture the response and relevant request log to locate that boundary.

A cached 404 can remain after the route is repaired. Compare the origin and public responses using authorized hosting diagnostics, then apply the platform's targeted cache procedure. Test the exact path after propagation. Avoid clearing unrelated application state when the evidence points to one cached endpoint.

Verify the maintained generator end to end

Fetch the chosen sitemap index, parse it, and open its relevant children. Confirm that a recent published article appears and that a private or draft record does not appear. Count the entries in a representative child and inspect the canonical form of its URLs. The correct endpoint can still expose a stale or incorrectly filtered set.

Open the sampled page directly and check its title, status, canonical, and intended indexability. Then confirm that robots.txt and the sitemap submission point to the maintained index. A publication should have a coherent route from its declaration to valid XML to an actual public page.

Test the next ordinary publishing action in a suitable environment. Create or update a harmless sample record, let the normal generator run, and verify the expected inclusion. A one-time uploaded XML file can make the endpoint look healthy while failing to follow future content changes.

Keep a record of which component owns the index, which public URL it serves, and which controls govern inclusion. When the next plugin upgrade changes behavior, that record helps separate an intentional replacement from a new routing or visibility fault.

Follow one provider that returns an empty child

The index can work while a particular content provider returns no entries. Choose a published post type that should appear and compare its public visibility and inclusion settings with the provider's query. An extension may deliberately exclude that post type, or a customization may filter every record after a taxonomy change.

Check a standard blog post as a control and inspect the child address advertised by the index. If the provider is intentionally disabled, its empty or obsolete child should be handled consistently by the maintained generator. If it should supply public records, fix the query or configuration that removes them and regenerate the index.

Test a newly published record of that type after the repair. A restored static list proves little about whether future items enter the provider's output. Record the post type, provider owner, eligible sample, and live child response so the next plugin or content-model change can be tested against the same expectation.

Frequently asked questions

Must every WordPress site use wp-sitemap.xml?

A site can use a maintained plugin sitemap or another appropriate generator. Inspect the endpoint actually advertised and used by the publication.

Can I fix the error by uploading an empty sitemap file?

A public file may satisfy a superficial response check while omitting the site's URLs. Repair the intended publishing workflow and verify its contents.

Why does the administrator see a sitemap while visitors do not?

Compare the same URL in a clean session. Access protection, preview routing, or caching can make the public response differ from an administrative view.

Check a page from the restored sitemap

Run the free page check on a current listed article. Confirm its public delivery alongside the sitemap index and child file you verified.

Filed under Platform guides. Topics: wordpress, sitemaps, troubleshooting