XML Sitemaps
10-20 minBeginner
XML Sitemaps act as a roadmap for search engines, listing all your important pages. While WordPress 5.5+ has a basic one built-in, SEO plugins generate much better ones with image support and exclude controls.
Prerequisites
- WordPress admin access
- SEO Plugin (recommended over core sitemaps)
Easy Recommended
Using Yoast SEO (Recommended)
Generates robust sitemap_index.xml automatically handled by the plugin.
1
Enable Sitemaps
1
Go to Yoast SEO > Settings > Site Features
2
Scroll to "XML sitemaps"
3
Ensure the toggle is ON
4
Click "View the XML sitemap" to verify
2
Exclude Content Types
1
Go to Settings > Content Types
2
Toggle "Show in search results" to OFF for any type you want EXCLUDED from sitemap
3
Common exclusions: Media, Tags, Format Archives
Best Practices
Do
- Submit your sitemap index to Google Search Console
- Exclude "Thank You" pages, Admin pages, and thin content
- Include images in your sitemap (SEO plugins do this automatically)
- Check for errors in the GSC Sitemaps report
Don't
- Manually edit a sitemap.xml file (let plugins handle it)
- Include redirected (301) or missing (404) URLs
- Worry if it takes days for Google to crawl it
- Create a static sitemap file that never updates
Verification Checklist
- Sitemap load at /sitemap_index.xml or /wp-sitemap.xml
- Sitemap contains only status 200 (live) URLs
- Noindex pages are NOT in the sitemap
- Sitemap is submitted to GSC and Bing Webmaster Tools
Pro Tips
- Break large sitemaps into chunks (Yoast does this automatically at 1,000 URLs)
- Video sitemaps are crucial for video-heavy sites (requires Premium plugins usually)
- If you block a page in robots.txt, remove it from the sitemap too
Common Issues & Fixes
Problem: Sitemap returns 404
Solution: Resave your Permalinks in Settings > Permalinks. This flushes rewrite rules.
Problem: Yoast Sitemap is blank
Solution: Check for plugin conflicts, or server caching (exclude sitemap_index.xml from cache).
Problem: Sitemap contains "author" archives I don't want
Solution: Go to Yoast SEO > Settings > Advanced > Author Archives and disable them.