Fix Guide

How to Create an XML Sitemap in WordPress

February 8, 2026

An XML sitemap helps search engines find and index all important pages on your WordPress site. While WordPress has built-in sitemap support since version 5.5, you may want more control over what gets included.

Option 1: Use the Built-in WordPress Sitemap

WordPress 5.5+ automatically generates a sitemap at /wp-sitemap.xml. No additional setup is needed. However, it has limited customization options.

Option 2: Use Yoast SEO

Yoast SEO generates a comprehensive sitemap with more features:

  1. Install and activate the Yoast SEO plugin.
  2. Go to Yoast SEO → Settings → Site features.
  3. Ensure XML sitemaps is enabled.
  4. Your sitemap will be available at /sitemap_index.xml.

Yoast automatically splits the sitemap into sub-sitemaps for posts, pages, categories, and other content types.

Option 3: Use Rank Math

  1. Install and activate Rank Math.
  2. Go to Rank Math → Sitemap Settings.
  3. Configure which post types and taxonomies to include.
  4. Your sitemap will be at /sitemap_index.xml.

Submit Your Sitemap to Search Engines

After creating your sitemap:

  1. Add the sitemap URL to your robots.txt: Sitemap: https://example.com/sitemap_index.xml
  2. Submit it in Google Search Console under Sitemaps.
  3. Submit it in Bing Webmaster Tools under Sitemaps.

Disable the Default WordPress Sitemap

If you use a plugin sitemap, disable the built-in one to avoid duplicates:

add_filter('wp_sitemaps_enabled', '__return_false');

Verify with InspectWP

Run an InspectWP scan to verify your sitemap is accessible. The SEO section will show whether a sitemap was found and its URL.

Check your WordPress site now

InspectWP analyzes your WordPress site for security issues, SEO problems, GDPR compliance, and performance — for free.

Analyze your site free