Sébastien Laframboise

Check and fix the WordPress XML sitemap

Check and fix the WordPress XML sitemap

The WordPress XML sitemap helps search engines discover the URLs you want to make visible. However, it doesn’t replace clear navigation or useful internal links. Google also points out that a sitemap does not guarantee crawling, indexing, or ranking of a page.

Its role remains important: it lets you verify that your site is presenting the correct addresses to search engines. You can thus spot a forgotten page, an unnecessary archive, or an old URL that should no longer appear.

Find the sitemap actually in use

Start by opening https://votredomaine.ca/wp-sitemap.xml replacing the domain with your own. WordPress natively generates this index when permalinks are active. The WordPress technical documentation on the sitemap index URL also gives the fallback address https://votredomaine.ca/?sitemap=index when the site doesn’t use permalinks.

A sitemap index doesn’t necessarily list every page directly. It lists multiple XML files instead, often separated by content type. So you might see a sitemap for posts, another for pages, categories, tags, or authors.

Before making any changes, identify the active generator. An SEO plugin can provide its own XML index and handle inclusions its own way. Also check https://votredomaine.ca/robots.txt : Google accepts a Sitemap: directive in that file, which can reveal the address the site is already communicating to robots.

Avoid accidentally submitting multiple addresses

Do not assume that sitemap.xml, wp-sitemap.xml and another index are all useful. Open each address you find, then keep the one that corresponds to the tool actually managing your SEO. Then submit that main index in Search Console.

If you use an SEO plugin, don’t edit its XML files by hand. They’re generally generated dynamically. Instead, fix the content, archive, or indexing setting that produces the unwanted URL.

Check the files listed in the index

Open each link in the index, one at a time. The goal isn’t to count every URL. You need to confirm that the content groups present match what you actually want to see in search results.

With WordPress’s native system, content sitemaps target public, queryable post types. Attachments are excluded, while included posts have the published status. You can confirm this in the reference from the WordPress sitemap provider for posts.

Therefore, a public custom post type can appear in your WordPress XML sitemap. This could be products, portfolios, events, or records created by a plugin. The presence of that file isn’t necessarily an error. Ask a simple question instead: do these pages provide useful information you want offered in search results?

Do a spot check

In each subsitemap, open a few recent URLs, a few older URLs, and one near the end of the file. This quick method will surface most configuration issues without reviewing hundreds of XML lines.

  • Does the URL open a public page that responds correctly?
  • Is this the address you want to keep, with the correct domain and HTTPS protocol?
  • Is the page still relevant to visitors and search engines?
  • Do you see duplicates, test pages, empty archives, or deleted content?
  • Does the page indicate a different canonical URL than the one listed in the sitemap?

Google recommends including the full URLs you want to appear in its results, preferably in their canonical form. A URL in the sitemap is a canonization signal, but it must be consistent with the site’s other signals. See the Google guidelines for creating and submitting a sitemap for details.

Your URL structure also matters. If you find confusing or inconsistent URLs across multiple files, first review the WordPress permalink settings for SEO. . A structural change then requires careful checking of redirects and the sitemap.

Spot content that shouldn’t be included

A clean sitemap doesn’t contain every technically accessible page. It contains the pages you actually want discovered. Test pages, duplicates, internal search results, account pages, or archives with no editorial value warrant review.

Category and tag archives deserve special attention. They can serve visitors when they group useful, distinct content. Conversely, a very thin or redundant archive isn’t always a good indexing target. To sort this at the source, see how to organize WordPress categories and tags.

Fix the cause, not just the XML file

If WordPress generates the native sitemap, its behavior follows the public content types, public taxonomies, and published posts. A lasting adjustment may therefore require changing the custom post type or a developer intervention using WordPress’s provided filters.

If Yoast SEO manages your sitemap, use its indexing settings. Its documentation explains that a content type removed from search results is also removed from the sitemap. It also explains how to exclude a specific URL or taxonomy if needed in customizing Yoast SEO’s XML index.

Don’t remove a page from the sitemap just because it isn’t getting traffic yet. First check its quality, purpose, and indexing status. A good recent page may need time and internal links to be discovered.

What if the sitemap returns an error 404?

If wp-sitemap.xml returns an error 404 on a site that should use the native sitemap, check Settings > Reading. The option that asks search engines not to index the site also disables native sitemaps. The WordPress reference on enabling sitemaps confirms that this feature depends on the site's visibility setting.

Then check whether an SEO plugin, a caching tool, or a custom configuration is overriding the native generator. Identify the single source before changing settings. Otherwise you could fix a URL that isn’t the one submitted to search engines.

Before changing a plugin setting, a content type, or code, create a reliable copy. You can follow the method shown in this WordPress backup before a risky change.

Submit the index and monitor the results

When your index contains the correct URLs, open Google Search Console, select the site property, then go to the Sitemaps report. Submit the full address of the index, not each of its sub-sitemaps, unless you have a specific reason to track them separately.

Google says this report lets you see when Googlebot fetched the sitemap and identify processing errors. After a fix, check the file status and then inspect a few important URLs in the indexing reports. Submission is a helpful signal, not a guaranteed indexing request.

Finally, repeat this check after a migration, domain change, redesign, adding a content type, or a major SEO settings change. That way your sitemap remains a useful list of preferred URLs rather than an inadvertent inventory of everything WordPress can display.