Seeing 404 errors in your Google Search Console sitemap report? You're not alone.
The problem: Your sitemap lists URLs that don't exist (anymore).
Why it matters: Wastes crawl budget, confuses search engines, and looks unprofessional.
The fix: Usually straightforward once you know what to look for.
What Causes Sitemap 404 Errors
1. Deleted Pages Still in Sitemap
Common scenario:
- Delete a blog post
- Forget to regenerate sitemap
- Old URL still listed
Example:
<url>
<loc>https://example.com/old-post</loc> ← Page was deleted
</url>
2. Changed URLs
Common scenario:
- Rename a page slug
- Change URL structure
- Old URL in sitemap, new URL live
Example:
Old: /blog/2024/11/post-title
New: /blog/post-title
Sitemap still has old URL
3. Incorrect URL Format
Common mistakes:
- Wrong domain
- HTTP vs HTTPS mismatch
- Trailing slash inconsistency
- URL encoding issues
Examples:
<!-- Wrong domain -->
<loc>http://example.com/page</loc> ← Should be https://
<!-- Trailing slash -->
<loc>https://example.com/page/</loc> ← Page is at /page (no slash)
<!-- Encoding -->
<loc>https://example.com/page with spaces</loc> ← Should be %20
4. Staging/Development URLs
Common mistake:
- Generate sitemap on staging
- Include staging URLs
- Deploy to production
Example:
<loc>https://staging.example.com/page</loc> ← Wrong domain!
5. Dynamic Sitemap Bugs
Issues:
- Database query errors
- Stale cache
- Logic bugs in sitemap generator
How to Find 404 Errors
Method 1: Google Search Console
Steps:
- Go to Sitemaps
- Click on your sitemap
- Look for "Errors" section
- Click to see specific URLs
What you'll see:
- List of 404 URLs
- When they were discovered
- Which sitemap they're in
Method 2: Use Sitemap Explorer (Fastest)
Steps:
- Go to Sitemap Explorer
- Enter your sitemap URL
- View the visual tree of all URLs
- Identify any URLs that look suspicious or outdated
Why it's useful:
- Instantly see all your sitemap URLs organized by structure
- Spot patterns in broken URLs (e.g., all from a deleted directory)
- No technical skills required
- Free and fast
Method 3: Other Online Tools
Alternative validators:
- XML Sitemap Validator
- Screaming Frog SEO Spider (crawl sitemap and test each URL)
How to Fix 404 Errors
Fix #1: Remove Deleted Pages
If page is truly deleted:
Option A: Manual fix (small sitemaps):
- Open your sitemap file in a text editor
- Find and remove the
<url>entry for the deleted page - Save and upload to your server
Option B: Regenerate sitemap (recommended):
Most platforms can automatically regenerate your sitemap:
- WordPress: Go to your SEO plugin (Yoast, Rank Math, etc.) → click "Regenerate sitemap"
- Shopify: Sitemap updates automatically when you delete products/pages
- Webflow: Sitemap regenerates automatically on publish
- Custom sites: Re-run your sitemap generation process
This ensures all deleted pages are removed and new pages are added.
Fix #2: Update Changed URLs
If URL changed, you have two options:
Option A: Update the sitemap
For manual sitemaps, find and replace the old URL with the new one in your sitemap file.
Option B: Add a redirect (recommended)
Keep the old URL working by redirecting it:
Apache (.htaccess):
# Redirect old URL to new URL
Redirect 301 /old-page /new-page
# Redirect entire directory
RedirectMatch 301 ^/old-dir/(.*)$ /new-dir/$1
Nginx:
# Redirect old URL
location /old-page {
return 301 /new-page;
}
# Redirect pattern
location ~ ^/old-dir/(.*)$ {
return 301 /new-dir/$1;
}
Then update your sitemap to use the new URLs.
Fix #3: Fix URL Format Issues
Common fixes:
HTTP → HTTPS:
Open your sitemap and do a find-and-replace:
- Find: http://yourdomain.com
- Replace: https://yourdomain.com
Most text editors support this. For dynamically generated sitemaps, update your sitemap generator to always use HTTPS.
URL encoding for special characters:
URLs with spaces or special characters need proper encoding:
- Spaces: page with spaces → page%20with%20spaces
- Use online tools like URL Encoder if needed
Fix #4: Regenerate Sitemap
If sitemap is completely out of date:
WordPress:
- Go to your SEO plugin settings (Yoast SEO, Rank Math, All in One SEO)
- Find the sitemap section
- Click "Regenerate sitemap" or similar
- Wait for completion
Other platforms:
- Shopify: Automatic - just wait 24 hours or republish your theme
- Wix: Automatic updates
- Squarespace: Automatic updates
- Custom sites: Re-run your sitemap generation process
Prevention Strategies
1. Automate Sitemap Updates
Most platforms do this automatically:
- WordPress: SEO plugins regenerate on publish/update
- Shopify: Updates within 24 hours of changes
- Webflow: Updates on publish
- Wix/Squarespace: Automatic updates
For custom sites: Set up your CMS to regenerate the sitemap whenever content is published, updated, or deleted.
2. Monitor Regularly
Weekly check:
- Review Search Console sitemap report
- Check for new errors
- Fix immediately
Set up alerts:
- Enable email notifications in Google Search Console
- Check weekly for new 404 errors
- Fix issues as soon as they appear
3. Use Absolute URLs
Always use full URLs in your sitemap:
<!-- Good -->
<loc>https://example.com/page</loc>
<!-- Bad -->
<loc>/page</loc> <!-- Relative URL -->
Most sitemap generators handle this automatically, but double-check if you're creating sitemaps manually.
Quick Fix Checklist
When you find 404 errors:
- ✅ Check Google Search Console for affected URLs
- ✅ Use Sitemap Explorer to visualize your sitemap structure
- ✅ Determine if pages are deleted, moved, or have URL issues
- ✅ Either remove URLs from sitemap or add 301 redirects
- ✅ Regenerate your sitemap
- ✅ Resubmit to Google Search Console
- ✅ Monitor weekly to catch new issues early
Next Steps
- Check Search Console for 404 errors
- Use Sitemap Explorer to visualize your sitemap
- Fix or remove problematic URLs
- Regenerate sitemap if needed
- Monitor weekly for new errors
Key Takeaways
- 404 errors waste crawl budget - Fix them promptly
- Common causes: Deleted pages, changed URLs, format issues
- Easy to fix: Remove, redirect, or update URLs
- Automate prevention: Use WordPress plugins or platform auto-updates
- Monitor regularly: Weekly Search Console checks
Bottom line: Sitemap 404 errors are common but easy to fix. Remove deleted pages, update changed URLs, and automate sitemap generation to prevent future issues.
Need help finding 404 errors? Analyze your sitemap to quickly identify problematic URLs.