Tutorial · wordpress · Published 2026-08-16 · 3 min read
WordPress XML sitemap setup with SEO plugins
WordPress XML sitemap plugins: Yoast and Rank Math generate dynamic sitemaps at /sitemap_index.xml. Avoid running two sitemap plugins at once.
Which plugin generates what
WordPress does not generate an XML sitemap by itself in any meaningful, configurable sense; the sitemap is produced by your SEO plugin. The three mainstream options, Yoast SEO, Rank Math, and All in One SEO, all watch your content, generate the sitemap on the fly, and regenerate it whenever you publish or update anything. The good news is they are mostly interchangeable, with the differences being where the settings live and which URL each serves.
Yoast SEO serves the sitemap index at /sitemap_index.xml, with child sitemaps per enabled content type (for example /post-sitemap.xml and /page-sitemap.xml). Rank Math serves its index at the same /sitemap_index.xml path, which makes switching between those two plugins painless because the URL, your robots.txt the Sitemap: line, and any Search Console submission all stay unchanged. All in One SEO is the exception, serving /sitemap.xml by default, so switching to it changes the URL and requires updating robots.txt and resubmitting to Search Console. Both Yoast and Rank Math automatically respect your noindex settings, meaning content you marked noindex does not appear in the sitemap, and Yoast additionally sends an X-Robots-Tag: noindex, follow header on its sitemap responses since sitemaps need not be indexed to be read.
Configuring the sitemap
Enable and confirm the sitemap in each plugin. In Yoast, that is Yoast SEO to Settings to the XML sitemaps toggle under technical settings, then open /sitemap_index.xml to verify it renders. In Rank Math, complete the setup wizard (it detects your site type and configures defaults) and confirm the setting under Rank Math Sitemap Settings. Both let you decide which content types and taxonomies are included, exclude individual URLs (free in Rank Math, premium-only for per-URL in Yoast), and control the URL limit per sitemap file, which defaults to 1000 entries.
After the sitemap works, tell search engines it exists. The cleanest way is to add a Sitemap: line to robots.txt, either via the plugin's editor or directly, pointing to https://yourdomain.com/sitemap_index.xml. Then submit the same URL in Google Search Console following the submit sitemap guide, and confirm the format follows the XML sitemap rules.
Troubleshooting a broken sitemap
When a WordPress sitemap is blank, partial, or an XML parsing error, the most common cause is more than one sitemap producer fighting. Having both Yoast and Rank Math installed, even with one deactivated, is frequently fatal: both register their own sitemap-generation routines, they conflict, and the output breaks. Fix by keeping a single active sitemap plugin and removing the other, then checking for any stale physical sitemap files.
Other common failures are the sitemap toggle being switched off after an update or migration, a robots.txt Disallow rule that matches the sitemap URL (which stops Googlebot fetching it even though the file exists), or the Sitemap: line pointing to the wrong path. Each is easy to confirm: open the sitemap URL in a browser to see it render, check robots.txt has no Disallow covering it, and verify the exact URL in the Sitemap: line. If you have recently migrated databases or hosts, the search replace database article is the right place to make sure the sitemap and site URLs still match the live domain.