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:
- Install and activate the Yoast SEO plugin.
- Go to Yoast SEO → Settings → Site features.
- Ensure XML sitemaps is enabled.
- 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
- Install and activate Rank Math.
- Go to Rank Math → Sitemap Settings.
- Configure which post types and taxonomies to include.
- Your sitemap will be at
/sitemap_index.xml.
Submit Your Sitemap to Search Engines
After creating your sitemap:
- Add the sitemap URL to your
robots.txt:Sitemap: https://example.com/sitemap_index.xml - Submit it in Google Search Console under Sitemaps.
- 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.