1. Home
  2. Guides
  3. SEO
SEO guide

What is an XML sitemap, and why does it matter?

Learn what an XML sitemap is, why it matters for SEO and how to manage URLs, indexing, sitemaps and content discovery correctly in WordPress.

  • Published August 18, 2026
  • 12 min read
  • WordPress guide

An XML sitemap is a file that helps search engines discover important URLs on a website. It provides crawlers with a structured list of pages that site owners want search engines to know about and can make content discovery easier, especially on larger or more complex websites.

For a WordPress website, an XML sitemap can contain posts, pages, custom post types, taxonomy archives and other public content. It acts as an additional discovery mechanism alongside normal internal links.

An XML sitemap is useful for SEO, but it is important to understand what it actually does. A sitemap does not guarantee indexing, does not improve rankings by itself and cannot compensate for poor content or weak website architecture. Its job is much simpler: helping search engines discover URLs that may be worth crawling.

What is an XML sitemap?

An XML sitemap is a machine-readable file containing a collection of URLs from a website.

Unlike a normal webpage designed primarily for human visitors, an XML sitemap is structured for search engines and other compatible crawlers. It follows the standardized Sitemap protocol so crawlers can process URLs consistently.

A basic sitemap might look like this:

<?xml version="1.0" encoding="UTF-8"?>

<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <url>
        <loc>https://example.com/</loc>
        <lastmod>2026-08-18</lastmod>
    </url>

    <url>
        <loc>https://example.com/guides/</loc>
        <lastmod>2026-08-16</lastmod>
    </url>

</urlset>

Each <url> element represents one URL included in the sitemap.

The <loc> element contains the absolute URL of the page:

<loc>https://example.com/guides/xml-sitemaps/</loc>

An optional <lastmod> element can indicate when that page was last significantly modified:

<lastmod>2026-08-18</lastmod>

A real sitemap may contain hundreds or thousands of URLs rather than the two shown in this simplified example.

The exact XML format, required elements and sitemap limits are defined by the Sitemaps protocol.

Why does an XML sitemap matter?

Search engines normally discover pages by following links.

If your homepage links to a category page, and that category page links to an article, a crawler can follow those links until it reaches the article.

An XML sitemap gives search engines another way to discover that article.

This becomes particularly useful when:

  • a website contains a large number of pages;
  • a website has recently launched;
  • some pages are several levels deep in the site structure;
  • new content is published frequently;
  • the website contains several custom post types;
  • some important URLs receive relatively few internal links;
  • large sections of content have recently been created or reorganized.

The sitemap therefore provides an additional structured source of URLs for search crawlers.

How search engines discover pages without a sitemap

To understand why XML sitemaps are useful, it helps to understand normal crawling.

Search engines discover links while crawling the web. When a crawler finds a link such as:

<a href="https://example.com/wordpress-guide/">
    WordPress Guide
</a>

it can discover the destination URL and potentially crawl it later.

This is why internal linking remains one of the foundations of a healthy website structure.

A sitemap does not replace that system. It supplements it.

A properly linked page can still be discovered without appearing in an XML sitemap, while a sitemap entry does not automatically make the corresponding page important within the website’s architecture.

An XML sitemap does not guarantee indexing

One of the most common sitemap misconceptions is that submitting a URL means search engines must index it.

They do not.

Sitemap inclusion means, in practical terms:

This is a URL on my website that I want search engines to know about.

Search engines still decide whether the page should actually appear in their index.

A page may be discovered through a sitemap and still not be indexed because of issues such as:

  • thin or low-value content;
  • duplicate or near-duplicate content;
  • a noindex directive;
  • a canonical pointing somewhere else;
  • access restrictions;
  • server errors;
  • other crawling or indexing decisions made by the search engine.

Think of the sitemap as a discovery signal, not an indexing command.

If pages are already present in the sitemap but still do not appear in Google, see Why isn’t my WordPress site showing up on Google? for the broader indexing checks.

Does an XML sitemap improve rankings?

Not directly.

Creating an XML sitemap does not automatically make a page rank higher.

Its value is primarily in discovery and crawl management. Helping a search engine discover a URL is a necessary preliminary step before that URL can be crawled, evaluated and potentially indexed.

But if the page itself is weak, a sitemap will not rescue it.

SEO still depends on the usefulness and relevance of the content, technical accessibility, internal linking, site architecture and many other signals.

What URLs should be included in an XML sitemap?

A sitemap should generally contain canonical URLs that you want search engines to discover and potentially index.

Typical examples include:

  • important posts;
  • important pages;
  • public custom post type entries;
  • useful taxonomy archives;
  • other canonical public URLs intended for organic search.

A useful rule is simple:

If you would not want the URL appearing in search results, ask whether it belongs in the sitemap at all.

Sitemap configuration should reflect your actual indexing strategy rather than blindly listing every URL WordPress can generate.

What should not be included in an XML sitemap?

Not every accessible URL needs to appear in the sitemap.

Depending on the website, you may want to exclude URLs such as:

  • pages intentionally marked noindex;
  • temporary utility pages;
  • duplicate URL variations;
  • internal search result pages;
  • low-value archives;
  • private or restricted content;
  • obsolete URLs that redirect elsewhere;
  • URLs whose canonical points to another page.

Including these URLs can produce a sitemap that does not match the site’s real indexing strategy.

A cleaner sitemap usually makes more sense than one containing every URL simply because the application is technically capable of generating it.

What is a sitemap index?

Large websites do not necessarily place every URL inside one XML file.

Instead, they can use a sitemap index.

A sitemap index contains references to several individual sitemap files:

<?xml version="1.0" encoding="UTF-8"?>

<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

    <sitemap>
        <loc>https://example.com/post-sitemap.xml</loc>
    </sitemap>

    <sitemap>
        <loc>https://example.com/page-sitemap.xml</loc>
    </sitemap>

    <sitemap>
        <loc>https://example.com/guide-sitemap.xml</loc>
    </sitemap>

</sitemapindex>

This allows content to be separated logically.

For example, a sitemap implementation could expose:

/sitemap_index.xml
    /post-sitemap.xml
    /page-sitemap.xml
    /guide-sitemap.xml
    /product-sitemap.xml
    /category-sitemap.xml

Separating content types can make large sitemap structures easier to generate, inspect and troubleshoot.

How many URLs can an XML sitemap contain?

The Sitemap protocol limits an individual sitemap file to 50,000 URLs and an uncompressed size of 50 MB.

If a website exceeds either limit, the URLs must be divided across multiple sitemap files.

A sitemap index can then reference those individual sitemap files.

For ordinary WordPress websites, this splitting should normally be handled automatically by WordPress core or by the sitemap system being used rather than assembled manually.

What does lastmod mean in an XML sitemap?

The <lastmod> value indicates when the content represented by a URL was last significantly modified.

For example:

<url>
    <loc>https://example.com/guides/wordpress-security/</loc>
    <lastmod>2026-08-18</lastmod>
</url>

This can give crawlers useful information about pages that have changed since an earlier visit.

The important word is significantly.

Google recommends using lastmod only when the value represents a real significant change to the page and is consistently accurate.

Updating the date every day when the content itself has not meaningfully changed makes the signal unreliable.

What about priority and changefreq?

The Sitemap protocol supports optional elements such as:

<changefreq>weekly</changefreq>
<priority>0.8</priority>

These describe a suggested change frequency and relative priority within the site.

However, Google explicitly states that it ignores both <changefreq> and <priority>.

This means that setting:

<priority>1.0</priority>

does not tell Google that a page deserves better rankings, more authority or some privileged position in the crawl queue.

The official Google Search Central sitemap documentation explains which sitemap elements Google uses and which ones it ignores.

If only changing an XML decimal were enough to command search rankings, an entire SEO industry could have been replaced by a dropdown menu years ago.

XML sitemap vs HTML sitemap

An XML sitemap and an HTML sitemap are not the same thing.

XML sitemap

An XML sitemap is primarily designed for machines and search crawlers.

Example:

https://example.com/sitemap_index.xml

HTML sitemap

An HTML sitemap is a normal webpage designed primarily for visitors.

It might contain organized links to major sections of the website:

  • Services;
  • Products;
  • Guides;
  • Documentation;
  • Contact information.

Both can help content discovery in different ways, but they serve different purposes.

XML sitemap vs robots.txt

An XML sitemap should also not be confused with robots.txt.

A sitemap helps crawlers discover URLs.

A robots.txt file provides crawling rules for compatible user agents and paths.

For example:

User-agent: *
Disallow: /private-area/

tells compatible crawlers not to crawl the matching path.

Meanwhile:

Sitemap: https://example.com/sitemap_index.xml

can be placed in robots.txt to advertise the location of a sitemap.

These systems complement each other, but they are not interchangeable. For the distinction between crawling instructions and indexing, see What is robots.txt, and why does it matter for SEO?.

Should you add your XML sitemap to robots.txt?

Adding a sitemap reference to robots.txt is a standard way to expose its location to compatible crawlers.

A typical entry looks like this:

Sitemap: https://example.com/sitemap_index.xml

The Sitemap directive can contain an absolute URL, which means it can clearly identify the sitemap location without requiring a crawler to infer it.

This does not replace sitemap submission through search engine webmaster tools, but it provides another discovery mechanism.

When editing crawler rules, make sure sitemap configuration is not accompanied by broader directives that accidentally obstruct important sections of the site. The guide Common robots.txt mistakes that hurt SEO covers those failure cases in more detail.

XML sitemaps in WordPress

WordPress core has included native XML sitemap functionality since WordPress 5.5.

The default sitemap index is available at:

https://example.com/wp-sitemap.xml

WordPress generates its sitemap dynamically rather than requiring a static XML file to be manually maintained.

By default, the core sitemap system can expose public and publicly queryable post types and taxonomies, along with other supported providers such as users where appropriate.

The WordPress Core team documents the implementation in its official WordPress XML Sitemaps documentation.

For many basic websites, the native sitemap provides a functional starting point without requiring a separate SEO plugin solely to produce an XML sitemap.

Websites with more advanced SEO requirements may still want additional control over which content types, taxonomies and individual URLs appear in the generated structure.

WordPress custom post types and XML sitemaps

Custom post types deserve particular attention because not every custom post type should necessarily be treated as a search landing page.

Imagine a website containing:

  • blog posts;
  • documentation;
  • portfolio projects;
  • internal templates;
  • utility content.

The first three might be useful search destinations, while the final two could exist only for internal website functionality.

Automatically including every available public content structure without reviewing its purpose can therefore expose URLs that do not belong in the site’s organic search strategy.

Before deciding whether a custom post type belongs in the sitemap, review its public URLs, archives, canonical behavior and indexing purpose. See WordPress custom post types and SEO for the broader content-model considerations.

Should taxonomy archives appear in an XML sitemap?

Categories, tags and custom taxonomies can create useful archive pages, but they can also produce large numbers of low-value URLs.

A taxonomy archive can be valuable when it acts as a real topic hub containing:

  • a useful introduction;
  • multiple relevant pieces of content;
  • clear navigation;
  • a meaningful purpose for visitors.

A taxonomy archive containing one item and no unique information is a very different case.

Therefore, do not decide whether taxonomies belong in the sitemap solely based on whether WordPress can generate them.

Decide whether those archive URLs deserve to be discoverable and indexable first.

How XML sitemaps work with canonical URLs

Sitemap URLs should generally correspond to the canonical versions of your pages.

Imagine these two URLs display essentially the same content:

https://example.com/product/
https://example.com/product/?ref=campaign

If the canonical version is:

https://example.com/product/

that is normally the version you would want represented in the XML sitemap.

Filling a sitemap with non-canonical URL variations creates an unnecessarily inconsistent representation of which URLs the website considers primary.

Do redirected URLs belong in the sitemap?

Normally, obsolete URLs that permanently redirect elsewhere should not remain in the active sitemap.

Consider:

https://example.com/old-guide/
    → 301
https://example.com/new-guide/

The sitemap should normally contain:

https://example.com/new-guide/

rather than continuing to advertise the obsolete address.

Redirects remain useful for visitors, external links and previously discovered URLs, but the sitemap should represent the website’s current preferred URL structure.

Should noindex pages be in an XML sitemap?

As a general SEO practice, intentionally noindex pages should not normally be included in a sitemap whose purpose is to expose URLs intended for indexing.

Otherwise the website effectively provides conflicting signals:

Here is a URL I am explicitly submitting for discovery, but the page also says that it should not appear in the index.

That does not mean the combination will somehow destroy the website. It simply makes the sitemap less consistent with the intended indexable URL set.

A well-maintained sitemap should reflect that set as closely as practical.

Submitting an XML sitemap to Google Search Console

Once a sitemap is publicly accessible, it can be submitted through Google Search Console.

Search Console allows verified site owners to provide a sitemap URL and monitor whether Google was able to fetch and process it.

This can help expose problems such as inaccessible or malformed sitemap files.

Submitting a sitemap does not create the sitemap and does not guarantee that the submitted URLs will be indexed.

It simply gives Google the sitemap location directly.

How often should an XML sitemap update?

A dynamic WordPress sitemap should normally reflect changes to the content it represents automatically.

For example, publishing a new indexable post may cause its URL to appear in the relevant sitemap without requiring somebody to manually regenerate an XML document.

Similarly, removing or changing the public status of content should eventually be reflected by the sitemap generator.

The objective is for the sitemap to describe the site’s current eligible URL structure rather than becoming a historical archive of everything the website has ever contained.

Should you resubmit the sitemap every time you publish?

Normally, no.

Once Google knows the sitemap URL, you do not need to manually submit the same sitemap again after every new WordPress post.

A dynamic sitemap can change at the same URL as new content is published.

The more useful maintenance task is making sure that the sitemap remains accessible and accurately reflects the site’s current content.

Common XML sitemap mistakes

1. Including every URL WordPress generates

More sitemap URLs do not automatically mean better SEO.

Include URLs that actually belong in the site’s indexation strategy.

2. Including noindex pages

If a page is deliberately excluded from indexing, including it in an index-oriented sitemap usually creates unnecessary inconsistency.

3. Including redirected URLs

Sitemap entries should normally point directly to current canonical destinations rather than obsolete URLs that immediately redirect.

4. Including duplicate URL variations

Tracking parameters and alternative representations of the same content should not unnecessarily inflate the sitemap.

5. Assuming the sitemap replaces internal linking

An XML sitemap is not a substitute for a usable website structure.

Important pages should still receive meaningful internal links from related content and navigation structures.

6. Using inaccurate modification dates

Do not make every page appear freshly modified when nothing meaningful has changed.

An unreliable lastmod value is considerably less useful than an accurate one.

7. Obsessing over priority and changefreq

Google ignores these values, so adjusting priority decimals is not a productive substitute for improving the actual site.

8. Creating a sitemap and never checking it again

Website structures evolve.

New post types may be introduced, sections may be removed and indexing strategies may change. Sitemap settings should evolve with them.

How to check your XML sitemap

Start by opening the sitemap URL directly in your browser.

Depending on your WordPress configuration, it may look similar to:

https://example.com/wp-sitemap.xml

or, when another sitemap system is active:

https://example.com/sitemap_index.xml

Then check whether:

  • the sitemap returns successfully;
  • the expected content types are present;
  • important URLs are included;
  • obsolete URLs are absent;
  • redirected URLs are not being listed unnecessarily;
  • URLs use the preferred HTTPS version;
  • canonical URL versions are being used;
  • unwanted content types are excluded.

These basic checks catch a surprising number of sitemap problems without requiring complicated tooling.

Check the sitemap before launching a WordPress site

A sitemap review is particularly important when moving a website from staging to production.

At launch, verify that:

  • the production sitemap is accessible;
  • URLs point to the production domain rather than staging;
  • important content is included;
  • temporary content is excluded;
  • the site is not accidentally configured to discourage indexing;
  • crawler rules do not block important resources or sections.

This belongs alongside the other technical checks performed before search engines begin discovering the production site. See A WordPress pre-launch SEO checklist for the complete launch review.

XML sitemap SEO checklist

Use this checklist when reviewing a WordPress sitemap:

  • Confirm that the sitemap is publicly accessible.
  • Include important indexable posts and pages.
  • Review custom post types individually.
  • Review categories, tags and custom taxonomies.
  • Exclude URLs that should not appear in search.
  • Avoid obsolete redirected URLs.
  • Use canonical URL versions.
  • Do not rely on the sitemap instead of internal links.
  • Keep lastmod values accurate when they are provided.
  • Do not rely on priority or changefreq for Google.
  • Add the sitemap location to robots.txt when appropriate.
  • Submit the sitemap through relevant search engine webmaster tools.
  • Review sitemap configuration when the site’s architecture changes.

Managing XML sitemaps with TheOneWP

WordPress already provides basic XML sitemap functionality, but websites with more complex structures may need additional control over what appears in their sitemap.

The TheOneWP XML Sitemap module provides dedicated sitemap management inside WordPress.

This makes sitemap configuration part of the site’s broader SEO setup rather than something that needs to be assembled manually.

For websites using several post types and taxonomies, this is particularly useful because sitemap configuration can follow the actual content architecture of the website.

A site might, for example, expose standard posts, pages and selected public custom content while leaving internal or irrelevant content outside the sitemap.

The goal is not to generate as many sitemap entries as possible. It is to give search engines a clean representation of the URLs that actually matter.

Do you always need an XML sitemap?

Not necessarily.

A very small website with clear internal linking may be discovered without difficulty even if it does not provide a sitemap.

Google itself notes that smaller sites with comprehensive internal linking may not need one.

However, XML sitemaps are inexpensive to maintain when generated automatically and provide a useful additional discovery mechanism.

For most WordPress websites, there is little operational downside to having a properly configured dynamic sitemap.

The important distinction is between having a sitemap and having a good sitemap.

A sitemap containing clean, canonical, indexable URLs supports the site’s technical structure.

A sitemap filled with redirects, duplicate URLs and content you deliberately do not want indexed simply publishes the underlying mess in XML format. Apparently even robots deserve cleaner paperwork.

Final thoughts: why XML sitemaps matter

An XML sitemap is one of the simplest technical SEO tools, but its purpose is frequently misunderstood.

It does not tell Google what to rank. It does not force pages into the index. It does not replace internal linking, useful content or a sensible website architecture.

Its job is to help search engines discover URLs and provide a structured view of the site’s current content.

For WordPress websites, the important step is therefore not merely enabling a sitemap. It is making sure the sitemap reflects the actual indexing strategy of the website.

Include canonical URLs that deserve to be discovered. Exclude unnecessary, duplicate, redirected or intentionally non-indexable URLs. Keep modification information accurate and review the configuration when the site architecture changes.

When those elements work together, an XML sitemap becomes exactly what it should be: a clean technical map of the content you want search engines to find.

Simplify your WordPress stack

A modular WordPress toolkit. 98 focused tools.

Ultimately, you can build cleaner workflows, maintain fewer plugins and enable only the features each website actually needs.