Yoast SEO or Rank Math Sitemap Shows 404 or Is Empty
If sitemap_index.xml gives a 404 or no URLs, the cause is usually permalinks, a rewrite conflict or a setting that excludes content.
Reference guide. This guide is written from established practice and the official documentation of the tools involved. We have not yet tested every step on a live demo site. Back up your site before you change anything.
What you see
Opening /sitemap_index.xml (Yoast) or /sitemap_index.xml (Rank Math) shows a 404 page, a blank page, or a sitemap with no posts.
Check in this order
- Sitemaps are switched on in the SEO plugin's settings. Both plugins let you turn the feature off.
- Save permalinks again (Settings, Permalinks, Save) to rebuild rewrite rules.
- Another sitemap is competing. WordPress has its own
wp-sitemap.xml, and a second SEO or sitemap plugin may clash. Keep one. - Content types are excluded. A post type or taxonomy may be set to hidden from search, which removes it from the sitemap.
- A caching or security plugin is blocking XML. Exclude the sitemap URLs from cache.
- A real file named sitemap.xml left in the site folder by an old tool can hide the dynamic one. Look in the root folder.
Then submit the working URL in Search Console. See indexing problems and Crawled - not indexed.
Related guides
- Writing Clear Error Reports: Screenshots, URLs and Steps
- WordPress Tag and Date Archives Duplicate Content: Settings
- WordPress Permalinks Change: Redirect Old URLs and Avoid 404s
- Error Establishing a Database Connection in WordPress: Full Checklist
Did this solve it? If not, email hello@sitefixlab.org with the exact error text and we will look into it. Try the problem finder.