WordPress XML Sitemap Not Working: 7 Proven Fixes (2026)

✍️ By Vikas Rohilla 📅 Updated: April 2026 ⏱️ 10 min read 🏷️ WordPress SEO

You have been publishing content consistently for months. Blog posts, landing pages, product pages — all live on your WordPress site. Then you open Google Search Console and see something that stops you cold:

“Couldn’t fetch.” “0 URLs submitted.” “Has errors.”

Your WordPress XML sitemap is not working — and until it is, Google is crawling your site without a roadmap. New content goes unnoticed. Rankings stall. Indexing delays stretch from days to weeks.

The worst part about a WordPress XML sitemap not working is that the problem is completely invisible from the frontend. Your site looks normal. Visitors browse normally. But Googlebot cannot find your pages efficiently — and you have no idea how long this has been going on.

This guide covers every reason a WordPress XML sitemap stops working, the exact diagnostic steps to find the cause, and the proven fixes — in the right order.

🚨 GSC showing errors right now? Jump to Fix 1 first — check whether your SEO plugin’s sitemap feature is actually enabled. This is the most common cause and takes under 2 minutes to verify. Then check Fix 2 for plugin conflicts — these two fixes alone resolve 80% of WordPress XML sitemap issues.
google search console sitemap not working couldn't fetch urls submitted error wordpress
Google Search Console → Sitemaps — “Couldn’t fetch” or “0 URLs submitted” are the two most common signs that your WordPress XML sitemap is not working correctly

What Is a WordPress XML Sitemap and Why Does It Matter?

A WordPress XML sitemap is a structured file — located at yourdomain.com/sitemap.xml or yourdomain.com/sitemap_index.xml — that lists every important URL on your site. It tells Google which pages exist, when they were last updated, and how often they change.

WordPress does not generate a sitemap on its own. The sitemap is created and maintained by your SEO plugin — RankMath, Yoast SEO, or All in One SEO. When the sitemap works correctly, you submit its URL to Google Search Console and Google uses it to crawl and index your content efficiently.

When your WordPress XML sitemap is not working, Google still crawls your site — but it relies entirely on finding links between pages. New posts, freshly updated pages, and deep content that lacks internal links are consistently the last to get indexed. For a site publishing content regularly, a broken WordPress XML sitemap directly delays rankings.

📖 Related: A broken sitemap is a core part of any technical SEO problem. Run a full Complete Technical SEO Audit to check your sitemap health alongside crawlability, indexing, and 80+ other signals — all in one place.

Why Is Your WordPress XML Sitemap Not Working?

🔴 Sitemap Feature Disabled

The sitemap toggle in RankMath or Yoast was turned OFF — after an update, migration, or fresh install. No toggle = no sitemap generated at all.

🔴 SEO Plugin Conflict

RankMath and Yoast both installed — even one deactivated. Their sitemap routines conflict directly, producing a blank or broken XML file.

🟡 Stale Cache

Caching plugin stored an old sitemap snapshot. New posts added but sitemap still shows old URLs. Google keeps indexing the outdated version.

🟡 Broken Permalink Rules

After a migration or plugin install, WordPress rewrite rules become stale. Sitemap URL generation breaks and returns 404 or blank output.

🔵 Blocked in robots.txt

A security plugin or migration tool added a Disallow rule for /sitemap.xml. Sitemap exists but Googlebot is being told not to read it.

🟢 PHP Memory / Firewall

Large sites hit PHP memory limits mid-generation — producing incomplete XML. Or a Cloudflare/firewall rule blocks the sitemap URL entirely.

Quick Diagnosis — Which Type Do You Have?

What You SeeMost Likely CauseFix To Use
Sitemap URL returns 404Sitemap feature disabled or permalinks brokenFix 1 then Fix 3
Sitemap URL shows blank white pagePlugin conflict (two SEO plugins) or PHP memoryFix 2 then Fix 5
Sitemap loads but XML parsing errorPHP memory limit — output cut off mid-fileFix 5
GSC shows “Couldn’t fetch”robots.txt blocking or Cloudflare/firewall ruleFix 4 then Fix 6
GSC shows 0 submitted / indexedStale cache or GSC submission not refreshedFix 3b + Fix 7
Sitemap fine but new posts missingCaching plugin serving old sitemapFix 3b

Fix 1: Verify the Sitemap Feature Is Enabled in Your SEO Plugin

This is the most common reason a WordPress XML sitemap is not working — and the easiest to miss. After plugin updates, fresh installs, or site migrations, the sitemap generation toggle in your SEO plugin can get reset to OFF. No toggle = no sitemap file generated at all.

For RankMath Users

  1. Go to WordPress Dashboard → RankMath → General Settings
  2. Click the Sitemap tab in the left sidebar
  3. Verify the main Sitemap toggle at the top is turned ON (blue)
  4. Save changes → visit yourdomain.com/sitemap_index.xml to confirm it loads
rankmath general settings sitemap toggle enable wordpress xml sitemap not working fix
RankMath → General Settings → Sitemap — the main toggle must be ON (blue) for your WordPress XML sitemap to generate. This is reset to OFF after some plugin updates and migrations.

For Yoast SEO Users

  1. Go to SEO → Features in your WordPress dashboard
  2. Find XML Sitemaps in the features list
  3. Verify the toggle is turned ON
  4. Save changes → visit yourdomain.com/sitemap_index.xml to confirm
yoast seo features xml sitemaps toggle enable wordpress sitemap not working
Yoast SEO → Features → XML Sitemaps toggle — must be ON for your sitemap to generate. Your sitemap URL will be yourdomain.com/sitemap_index.xml

For All in One SEO Users

  1. Go to All in One SEO → Sitemaps → XML Sitemap
  2. Verify Enable Sitemap is toggled ON
  3. Save → check yourdomain.com/sitemap.xml
✅ Sitemap now loading? Proceed to Fix 7 to resubmit it in Google Search Console. Even if your sitemap was previously submitted, a fresh submission forces an immediate recrawl after fixing the issue.

Fix 2: Resolve the SEO Plugin Conflict

If you have both RankMath and Yoast SEO installed — even if one appears deactivated — your WordPress XML sitemap will not work correctly. Both plugins register their own sitemap generation routines with WordPress. When both are present, these routines conflict. The output is either a blank sitemap, a partial XML file, or an XML parsing error.

⚠️ “Deactivated” is not enough. A deactivated plugin still has its files on your server. Some plugin hooks and database entries persist even when the plugin is not active. For SEO plugins specifically, you must fully delete the one you are not using — not just deactivate it.
  1. Go to WordPress Dashboard → Plugins → Installed Plugins
  2. Check if both RankMath and Yoast SEO (or All in One SEO) appear in the list
  3. Decide which SEO plugin you want to keep — the one you actively configure and use
  4. For the plugin you are removing: click Deactivate → then click Delete
  5. After deleting — visit your sitemap URL again: yourdomain.com/sitemap_index.xml
  6. If the sitemap now loads cleanly — the conflict was the cause
📖 Also useful: Not sure which SEO plugin your site is running? Use the free WordPress Theme & Plugin Analyzer to see your complete plugin stack in one scan — including any duplicate or conflicting SEO tools.

Fix 3: Flush Permalink Rules and Purge Sitemap Cache

Two separate but related issues can cause a WordPress XML sitemap to stop working or show outdated URLs: stale WordPress permalink rewrite rules, and a caching plugin serving an old cached version of your sitemap.

Fix 3a — Flush Permalink Rules (Fixes 404 and Blank Sitemap)

WordPress builds your sitemap URLs using the same rewrite rule system that creates your post and page URLs. After a migration, server move, or certain plugin installations, these rules become stale. The sitemap URL returns a 404 or a blank page until the rules are rebuilt.

  1. Go to WordPress Dashboard → Settings → Permalinks
  2. Do not change your permalink structure — just click Save Changes with the existing setting
  3. This flushes and rebuilds all WordPress rewrite rules including sitemap URL routing
  4. Visit your sitemap URL again to confirm it now loads
💡 Why this works: Clicking Save Changes in Permalinks triggers a full flush of WordPress’s rewrite rule cache — stored in the wp_options database table under the rewrite_rules key. This one click rebuilds URL generation for the entire site, including sitemap URLs, without changing any settings.

Fix 3b — Purge Sitemap Cache (Fixes Missing New Posts in Sitemap)

If your sitemap loads but newly published content is not appearing in it, your caching plugin has stored a snapshot of the old sitemap. New posts exist on your site but are invisible to Google until the cache is purged and regenerated.

  • LiteSpeed Cache: Dashboard → LiteSpeed Cache → Purge → Purge Sitemap. Then in your SEO plugin — regenerate the sitemap manually.
  • WP Rocket: WP Rocket → Tools → Clear Cache → Clear All. Then regenerate sitemap from your SEO plugin settings.
  • W3 Total Cache: Performance → Purge All Caches. Then regenerate sitemap.
📖 Related: Caching issues affect more than just your sitemap — they can also delay updates to your Core Web Vitals scores. Read the WordPress Speed Optimization Guide for a complete approach to managing caching correctly.

Fix 4: Check Your robots.txt for Sitemap Blocking

This is the most surprising cause of a WordPress XML sitemap not working in Google Search Console — and it costs sites weeks of SEO progress before the owner discovers it. A robots.txt file that contains a Disallow rule matching your sitemap URL tells Googlebot not to access your sitemap — even though the file itself exists perfectly on your server.

How to Check Your robots.txt

  1. Open a new browser tab
  2. Navigate to yourdomain.com/robots.txt
  3. Read every line of the file carefully
  4. Look for any Disallow line that includes /sitemap, /sitemap.xml, or /sitemap_index.xml
  5. Also check for wildcard rules like Disallow: /*.xml — this blocks all XML files including your sitemap
robots.txt sitemap line wordpress xml sitemap not working fix blocked googlebot
Your robots.txt should contain a Sitemap: line pointing to your sitemap URL — not a Disallow rule blocking it. A misconfigured robots.txt is a common hidden cause of WordPress XML sitemap not working in GSC.

What a Correct robots.txt Should Look Like

User-agent: * Disallow:Sitemap: https://yourdomain.com/sitemap_index.xml

The Sitemap: line at the bottom actively tells Googlebot where your sitemap is located. Most SEO plugins add this line automatically when the sitemap feature is enabled. Verify it is present — and that no Disallow rule above it contradicts it.

How to Fix a Blocked robots.txt

  1. In RankMath: go to RankMath → General Settings → Edit robots.txt → remove any Disallow line blocking the sitemap URL
  2. In Yoast SEO: go to SEO → Tools → File Editor → edit robots.txt → remove conflicting Disallow rules
  3. Via cPanel File Manager: open public_html/robots.txt → edit directly → save
⚠️ Common culprit: Security plugins like Wordfence and iThemes Security sometimes add aggressive robots.txt rules during initial setup — including rules that block sitemap-related URLs. Always check robots.txt after installing any security plugin.

Fix 5: Increase PHP Memory Limit for Large Sites

On large WordPress sites — those with hundreds of posts, WooCommerce stores with many products, or sites with multiple custom post types — PHP can run out of allocated memory while generating the sitemap. When this happens, the XML output gets cut off mid-file. The sitemap URL loads, but the XML is incomplete and unparseable — causing an XML parsing error in Google Search Console.

How to Confirm This Is the Cause

  1. Open your sitemap URL: yourdomain.com/sitemap_index.xml
  2. View the page source (Ctrl + U in Chrome)
  3. Scroll to the very end of the source — if the XML does not end with a proper closing tag like </sitemapindex> — the output was cut off
  4. A missing closing tag confirms the PHP memory limit is the cause

How to Fix the PHP Memory Limit

  1. Open cPanel File Manager → public_html → wp-config.php
  2. Add this line before the /* That’s all, stop editing! */ comment:
define( ‘WP_MEMORY_LIMIT’, ‘256M’ );
  1. For WooCommerce stores or very large sites — use 512M instead of 256M
  2. Save wp-config.php
  3. Go to your SEO plugin settings and manually trigger a sitemap regeneration
  4. Visit the sitemap URL again and check the source for the proper closing tag

Growing site hitting PHP memory limits repeatedly?

Hostinger Business and Cloud plans offer higher PHP memory allocations, dedicated resources, and better MySQL performance — built for sites that have outgrown shared hosting constraints.

Upgrade Hosting →

Fix 6: Check for Cloudflare or Firewall Blocking

If your sitemap loads fine in your browser but Google Search Console consistently shows “Couldn’t fetch” — the issue may not be your WordPress setup at all. A Cloudflare WAF rule or a WordPress security plugin can be blocking Googlebot’s IP range from accessing /sitemap.xml, treating it as automated bot traffic.

How to Diagnose a Firewall Block

  1. Open your sitemap URL in an incognito browser window — if it loads normally, your browser is fine
  2. Go to Google Search Console → URL Inspection Tool
  3. Enter your sitemap URL → click Test Live URL
  4. If GSC’s live test shows an error but your browser loads it fine — a firewall is blocking Google’s crawlers specifically

Cloudflare Fix

  1. Log into your Cloudflare dashboard → select your domain
  2. Go to Security → WAF → Custom Rules
  3. Review any rules that match URL paths containing sitemap or .xml
  4. Add an exception or bypass rule for /sitemap*.xml to allow Googlebot through
  5. Also check Security → Bots → Bot Fight Mode — if enabled, it can challenge Googlebot. Add Google’s crawlers to the allowlist.

Security Plugin Fix

  • Wordfence: Wordfence → Firewall → Web Application Firewall → check for any rules blocking the sitemap URL pattern. Add an exclusion if needed.
  • iThemes Security: Security → Settings → 404 Detection — aggressive 404 blocking can flag sitemap URLs from new crawlers. Add sitemap paths to the whitelist.
  • All In One WP Security: Firewall → Basic Firewall Rules — check for any XML file blocking rules and add an exception for your sitemap.
📖 Related: Firewall misconfigurations that block Googlebot are also a common cause of crawlability issues beyond just the sitemap. After fixing — run a full technical SEO audit to confirm Google can access all your important pages: Complete Technical SEO Audit Guide.

Fix 7: Resubmit Your Sitemap in Google Search Console

After fixing the underlying cause — do not wait for Google to discover the change on its own. Google Search Console caches sitemap error states, and a “Couldn’t fetch” or “Has errors” status can persist for days even after your sitemap is fully functional again. Resubmitting forces an immediate fresh crawl attempt.

  1. Open Google Search Console → Sitemaps in the left sidebar
  2. Find your existing sitemap submission — note the current error status
  3. Click on the sitemap URL → click the three-dot menu → select Remove sitemap
  4. After removing — click Add a new sitemap
  5. Enter your sitemap URL: sitemap_index.xml (for RankMath and Yoast) or sitemap.xml
  6. Click Submit
  7. Monitor the Coverage report over the next 24–48 hours to confirm URLs are being queued for indexing
google search console sitemaps panel submit sitemap resubmit wordpress xml sitemap not working fix
Google Search Console → Sitemaps → delete the old error submission → resubmit fresh. This forces an immediate crawl attempt and clears the cached error state — essential after fixing a WordPress XML sitemap issue.
💡 Use URL Inspection after resubmitting: For specific posts that were not indexing, go to GSC → URL Inspection Tool → enter the post URL → click Request Indexing. This queues individual URLs for priority indexing — useful for your most important content after a sitemap issue is resolved.
🔍

ToolXray Free WordPress Technical Audit

Check your sitemap health alongside Core Web Vitals, PageSpeed, TTFB, broken links and 80+ SEO signals — all in one free scan. No signup required.

Run Free Audit →

How to Prevent WordPress XML Sitemap Issues

  • Never run two SEO plugins simultaneously: RankMath, Yoast, and All in One SEO cannot coexist. Pick one and fully delete the others. Check your plugin list quarterly — developers sometimes install a second SEO plugin for testing and forget to remove it.
  • Purge sitemap cache after every content publish: Configure your caching plugin to exclude sitemap URLs from caching — or build a habit of purging the sitemap cache every time you publish a batch of new content. LiteSpeed Cache has a dedicated Purge Sitemap button for this reason.
  • Check robots.txt after every security plugin update: Security plugins can add or modify robots.txt rules during updates. Verify yourdomain.com/robots.txt still contains a proper Sitemap: line and no conflicting Disallow rules after any security plugin update.
  • Monitor GSC Coverage report weekly: The Coverage report shows you the exact number of submitted vs indexed URLs. A sudden drop or a “Has errors” status is the earliest warning sign that your WordPress XML sitemap has stopped working. Catching it early minimizes indexing delays.
  • Check INP and Core Web Vitals after fixing: A sitemap outage can temporarily suppress rankings. After fixing — monitor your performance signals and read Fix INP in WordPress and Fix LCP in WordPress to ensure your recovery is complete.
  • Use a site monitoring tool: Tools that regularly fetch your sitemap URL and alert you if it returns an error give you instant notification when the sitemap breaks — before Google has been crawling blind for days.
📖 Related: A sitemap issue is just one of many technical SEO problems that can silently hurt your rankings. For a full audit of every technical layer — crawlability, indexing, performance, schema — read our Technical SEO for Beginners guide and the Complete Technical SEO Audit walkthrough.

The Bottom Line

A WordPress XML sitemap not working is almost always caused by one of seven issues: sitemap feature disabled in your SEO plugin, plugin conflict between two SEO tools, stale permalink rules, cached outdated sitemap, robots.txt blocking, PHP memory limits, or a Cloudflare/firewall rule intercepting Googlebot. Work through the fixes in order and you will identify the cause before you reach Fix 5 in most cases.

The most important step after any fix is to resubmit your sitemap in Google Search Console immediately — not passively wait for Google to rediscover the change. A fresh submission triggers an immediate crawl attempt and clears the cached error state from your GSC dashboard.

The broader lesson: your WordPress XML sitemap is one of the most important files on your site for SEO, yet most site owners never check it after the initial setup. A monthly 30-second check of your GSC Sitemaps panel is enough to catch any issue before it causes meaningful ranking damage.

🔍 Free WordPress Technical Audit

Check your sitemap health, Core Web Vitals, PageSpeed, broken links and 80+ SEO signals — free, no signup

Run Free Audit at ToolXray →

Related Articles

🔬

Complete Technical SEO Audit

Sitemap fixed — now audit the full technical stack. Crawlability, indexing, schema and 80+ signals.

🔁

ERR_TOO_MANY_REDIRECTS Fix

Another WordPress error that silently blocks Googlebot. 7-step diagnosis and fix guide.

🚀

WordPress Speed Optimization

After fixing your sitemap — optimize for PageSpeed 90+ scores and faster indexing signals.

📐

Advanced Schema Markup Guide

Sitemap gets Google to your pages — schema gets you rich results. The next SEO layer to implement.

📱

Mobile-Friendly Website Check

Once Google indexes your pages via sitemap — confirm they pass mobile usability checks too.

🆓

Free Alternative to Ahrefs

Monitor your site’s indexing recovery and rankings with free SEO tools — no paid subscription needed.

Frequently Asked Questions

❓ Why is my WordPress XML sitemap not working after a migration?
Site migrations are one of the most common triggers of WordPress XML sitemap issues. After a migration, WordPress permalink rewrite rules often become stale — causing the sitemap URL to return a 404 or blank page. The fix is a single click: Settings → Permalinks → Save Changes. This rebuilds all WordPress rewrite rules without changing your permalink structure. Also verify that no Disallow rules were added to robots.txt during the migration process, and that your SEO plugin’s sitemap feature is still enabled after the database transfer.
❓ My sitemap URL loads but Google Search Console says “Couldn’t fetch” — why?
If your sitemap loads correctly in your browser but Google Search Console reports “Couldn’t fetch,” the most likely cause is a Cloudflare WAF rule or security plugin that is blocking Googlebot’s IP range from accessing the sitemap URL. Your browser can access it because it uses your IP — but Google’s crawler is being intercepted. Use GSC’s URL Inspection Tool → Test Live URL to see exactly what Google’s crawler is receiving. Then check your Cloudflare firewall rules and security plugin settings for any rules matching /sitemap.xml or /*.xml and add an exception for Googlebot.
❓ How many URLs should my WordPress sitemap contain?
Your WordPress XML sitemap should contain all URLs that you want Google to index — published posts, pages, categories, tags, and product pages (for WooCommerce). It should not contain noindex pages, password-protected pages, admin URLs, or duplicate content URLs. RankMath and Yoast both allow you to exclude specific post types and taxonomies from the sitemap — use these settings to keep your sitemap clean. A sitemap with too many low-quality or thin URLs can actually slow down Google’s crawling of your important pages.
❓ Does a broken sitemap delete my content from Google’s index?
No — a broken sitemap does not remove already-indexed pages from Google’s index. Pages that Google has previously indexed remain in the index even when the sitemap stops working. What a broken sitemap affects is the discovery and indexing of new and updated content. New blog posts, recently updated pages, and fresh product listings will take longer to be found and indexed by Googlebot without a working sitemap. The longer the sitemap is broken, the more new content accumulates that Google cannot efficiently discover.
❓ How long after fixing the sitemap will Google start indexing my pages again?
After fixing the WordPress XML sitemap and resubmitting it in Google Search Console, Google typically begins recrawling within 24–48 hours for most sites. High-authority sites with frequent crawls may see indexing updates within hours. Lower-authority or newer sites may take 3–7 days to see the Coverage report update with newly queued URLs. Speed up the process by using GSC’s URL Inspection Tool to manually request indexing for your most important new pages — this queues them for priority crawling regardless of the sitemap crawl cycle.

    Leave a Comment

    Your email address will not be published. Required fields are marked *

    Scroll to Top