Lifetime Deal Get lifetime Pro access for a one-time payment, First 100 founding members only Lifetime access · first 100 only See pricing →
Rank Bix SEO logo RankBix
Complete guide

XML sitemaps for WordPress: the complete guide.

Everything you need to know about XML sitemaps: what they are, how they work, how to create one in WordPress, what to include and exclude, and how to submit it to Google. Updated for 2025.

Chapter 1

What is an XML sitemap?

An XML sitemap is a file that lists the URLs of all the important pages on your website in a structured format that search engines can read. The file uses XML (Extensible Markup Language), a text-based format designed for machine-readable data.

A sitemap is essentially a map of your site that you hand directly to Google, Bing, and other search engines. Instead of those crawlers having to discover all your pages by following links from page to page (which can take days or weeks for new content), your sitemap tells them exactly where to look and which pages you consider important.

XML sitemaps are different from HTML sitemaps. An HTML sitemap is a human-readable page on your website listing your content categories and posts, sometimes used as a navigation aid for visitors. An XML sitemap is purely for search engines. Most WordPress SEO plugins generate the XML sitemap automatically; you do not need to create or edit the file manually.

A minimal XML sitemap URL entry looks like this:
<url>
  <loc>https://example.com/wordpress-seo-guide/</loc>
  <lastmod>2025-06-01</lastmod>
  <changefreq>monthly</changefreq>
  <priority>0.8</priority>
</url>
Chapter 2

Why sitemaps matter for SEO

Search engines can discover your pages without a sitemap by following links from page to page. So do you really need one? For most sites, yes, and for several important reasons.

Faster indexing of new content
When you publish a new post, Google may not discover it for days or weeks if it relies only on link-following. With a sitemap, Googlebot sees the new URL quickly, often within hours of publication if combined with a ping.
Ensures all pages are discoverable
Pages with no internal links pointing to them (orphaned pages) will never be discovered by crawlers following links. A sitemap guarantees they are at least visible to search engines.
Signals content importance
Including a URL in your sitemap signals that you consider it important. Pages excluded from the sitemap send the opposite signal, which is useful for keeping thin or utility pages out of the crawl budget.
Supports large sites
On sites with thousands of pages, link-following crawling is inefficient. A sitemap gives Google a direct inventory, improving crawl efficiency and ensuring all important URLs are processed regularly.
Video and image rich results
Separate image and video sitemaps provide metadata (image captions, video thumbnails, duration) that enables rich results in Google Images and Google Video search.
Monitoring tool
Google Search Console shows you how many sitemap URLs were submitted vs how many were indexed. This discrepancy is a useful diagnostic for crawl issues and noindex tags you may have applied incorrectly.
Chapter 3

Anatomy of an XML sitemap

A valid XML sitemap must follow the Sitemap Protocol specification (sitemaps.org). Here is what a complete, minimal sitemap file looks like and what each element means.

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">

  <url>
    <loc>https://example.com/</loc>
    <lastmod>2025-06-01</lastmod>
    <changefreq>weekly</changefreq>
    <priority>1.0</priority>
  </url>

  <url>
    <loc>https://example.com/wordpress-seo-guide/</loc>
    <lastmod>2025-05-15</lastmod>
    <changefreq>monthly</changefreq>
    <priority>0.8</priority>
  </url>

</urlset>
<urlset>
The root element of the sitemap. The xmlns attribute points to the Sitemap Protocol namespace. Required.
<url>
Wraps the data for one URL entry. Each page gets its own <url> block. Required.
<loc>
The full URL of the page, including protocol (https://). This is the only required element inside <url>.
<lastmod>
The date the page was last significantly modified, in YYYY-MM-DD format. Optional but recommended. Google uses this to prioritise which pages to recrawl.
<changefreq>
How often the page is likely to change: always, hourly, daily, weekly, monthly, yearly, never. Optional. Google treats this as a hint, not an instruction.
<priority>
The relative importance of this URL compared to other URLs on your site, from 0.0 to 1.0. Default is 0.5. Optional. Google does not weight this heavily.
Chapter 4

Creating a sitemap in WordPress

WordPress 5.5 and later include a very basic sitemap at /wp-sitemap.xml by default. However, the built-in sitemap is limited: it does not support lastmod dates, it includes low-value content like author pages and date archives, and you cannot configure what it includes or excludes.

For a properly optimised sitemap, use an SEO plugin. Rank Bix SEO generates a dynamic, configurable sitemap that is automatically kept up to date as you publish, edit, and delete content.

Setting up your sitemap with Rank Bix

  1. Install and activate Rank Bix SEO from WordPress.org
  2. Go to Rank Bix SEO in your WordPress admin menu
  3. Navigate to Settings and then Sitemap
  4. Choose which post types and taxonomies to include (posts, pages, products, categories, tags)
  5. Toggle off any content types that should not be indexed (author archives, date archives, tag archives with fewer than 10 posts)
  6. Save settings. Your sitemap is now live at yourdomain.com/sitemap.xml

Disabling the WordPress default sitemap

When you activate Rank Bix, it automatically disables the WordPress built-in sitemap at /wp-sitemap.xml to avoid duplicate sitemaps confusing Google. If you are using a different SEO plugin, add this code to your functions.php to disable the WordPress default:

add_filter( 'wp_sitemaps_enabled', '__return_false' );
Chapter 5

What to include and exclude from your sitemap

A well-maintained sitemap should contain only the pages you want indexed. Including low-quality or irrelevant URLs dilutes your sitemap and wastes Google's crawl budget on your site.

Include in sitemap
Published posts and pages
Product pages (WooCommerce)
Category and tag pages with substantial content
Author pages on multi-author sites
Service pages and landing pages
Resources, guides, and evergreen content
Exclude from sitemap
Admin and login pages (/wp-admin/)
Thank you and confirmation pages
Date archive pages
Thin tag archives (under 5 posts)
Cart, checkout, and account pages
Search results pages (?s=query)
Pages with noindex meta tags
Private or password-protected pages
Important rule
Never include a URL in your sitemap that has a noindex meta tag. This creates a contradiction: you are simultaneously telling Google to index the page (sitemap) and not index it (noindex). While Google will follow the noindex directive, this inconsistency creates unnecessary crawling overhead.
Chapter 6

Sitemap index files

A single XML sitemap file can contain a maximum of 50,000 URLs and must not exceed 50 MB uncompressed. For sites with more than a few hundred pages, most SEO plugins (including Rank Bix) generate a sitemap index file instead of a single sitemap.

A sitemap index file is an XML file that lists multiple individual sitemaps, each covering a specific content type or a chunk of URLs. You submit the single index file URL to Google Search Console and Google discovers all the child sitemaps from it.

A typical Rank Bix sitemap index structure:
/sitemap.xml               <-- sitemap index (submit this to GSC)
  /sitemap-posts.xml       <-- all published blog posts
  /sitemap-pages.xml       <-- all published pages
  /sitemap-products.xml    <-- WooCommerce products
  /sitemap-categories.xml  <-- category taxonomy pages
  /sitemap-images.xml      <-- image sitemap for Google Images
  /sitemap-videos.xml      <-- video sitemap (Pro only)
Chapter 7

Submitting your sitemap to Google

Generating a sitemap is only half the job. You also need to tell Google where it is. There are two ways: submitting through Google Search Console and referencing the sitemap URL in your robots.txt file.

Method 1: Submit via Google Search Console

This is the recommended method. Log into GSC, select your property, go to Indexing then Sitemaps in the left sidebar, and enter your sitemap URL in the field. Click Submit. Google will process the sitemap and show you the status, number of URLs discovered, and any errors within a few hours to a day.

Method 2: Reference in robots.txt

Add a Sitemap directive to your robots.txt file. This allows any crawler (including Bing and Yandex) to discover your sitemap automatically without a manual submission to each search engine. Rank Bix adds the Sitemap directive to your robots.txt automatically when you activate the sitemap.

User-agent: *
Disallow: /wp-admin/

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

Do you need to submit to Bing?

Bing Webmaster Tools also accepts sitemap submissions and if you are using Rank Bix, the IndexNow feature automatically pings Bing each time you publish or update content. However, submitting your sitemap to Bing Webmaster Tools once provides an additional signal and gives you access to Bing's equivalent of the Coverage report to diagnose any indexing issues.

Chapter 8

Monitoring and fixing sitemap issues

After submitting your sitemap, check the Sitemaps report in Google Search Console regularly. This report shows you the number of URLs submitted, the number Google has indexed, and any errors. A large gap between submitted and indexed URLs is a signal worth investigating.

Submitted count is much higher than indexed count
Check the Coverage report for noindex, redirect, or duplicate content exclusions. Pages excluded for these reasons are counted in "submitted" but not in "indexed". If you have many noindexed pages in your sitemap, remove them from the sitemap.
Sitemap returns a fetch error
Your sitemap URL may be incorrect, the file may be inaccessible, or the server may be blocking Googlebot. Verify the URL loads in a browser. Check that your robots.txt does not disallow Googlebot from accessing the sitemap.
Sitemap says "Couldn't fetch"
This usually means a temporary server error. Wait 24 hours and check if the status resolves. If it persists, check your server error logs and ensure the sitemap file is generating correctly.
Pages in sitemap have "Crawled but not indexed" status
Google crawled the page but decided not to index it. This usually indicates thin content, duplicate content, or a page Google considers low-value. Improve the content quality or consolidate it with a more comprehensive page.
Sitemap shows "Success" but with 0 submitted URLs
Your SEO plugin may have generated an empty sitemap. Check that you have at least one published post type enabled in the sitemap settings and that those posts are published (not drafts).
Chapter 9

XML sitemap best practices

Only include canonical URLs. If you have redirects, list the final destination URL, not the redirecting URL.
Keep lastmod dates accurate. Update them when you make significant content changes. Do not update them if you only changed a typo.
Do not include URLs that are noindex. Review your sitemap periodically and remove any pages you have since noindexed.
Use absolute URLs (https://example.com/page/) not relative paths (/page/). The sitemap specification requires absolute URLs.
Submit the sitemap index URL to Google Search Console rather than individual child sitemap URLs.
Add a Sitemap: directive to your robots.txt so all crawlers can discover it automatically.
Regenerate and resubmit your sitemap after major restructuring, domain changes, or HTTPS migrations.
For large sites (10,000+ URLs), monitor the sitemap processing time in GSC. Long processing times may indicate crawl budget constraints.
Use image sitemaps for sites that rely on Google Image Search traffic. Include image title, caption, and licence information where available.
Use video sitemaps for sites with video content. Include video title, description, thumbnail URL, and duration.
Get your sitemap in place

Rank Bix generates and manages your sitemap automatically.

Install Rank Bix SEO and your XML sitemap is live in under a minute. Configure which content types to include, and Rank Bix keeps it updated automatically every time you publish or edit content.

Free forever on WordPress.org. No account required.

Start free. Upgrade when you're ready.

Install Rank Bix SEO on your WordPress site in seconds. No account, no upsell, no bloat. Upgrade to Pro whenever you need the advanced tools.

Already on Yoast, Rank Math or AIOSEO? Our one-click importer migrates everything.