Whitespace Fixer for XML Sitemap
Fixes XML declaration errors in sitemaps and RSS by removing leading whitespace. Just activate, no setup required.
Plugin info
Maintenance & Compatibility
Maintenance score
Actively maintained • Last updated 72 days ago • 2 reviews
Is Whitespace Fixer for XML Sitemap abandoned?
Likely maintained (last update 72 days ago).
Compatibility
Languages
Similar & Alternatives
Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.
Description
Whitespace Fixer for XML Sitemap is a lightweight plugin that automatically removes unwanted spaces or blank lines before the XML declaration () in your WordPress output.
This small whitespace, often caused by themes or plugins, breaks XML feeds and causes browser or validator errors like:
XML declaration allowed only at the start of the document
With this plugin activated, the output buffer is cleaned before anything is sent to the browser—ensuring your sitemaps and RSS feeds are valid and readable by search engines like Google.
✅ Works with:
– Rank Math
– Yoast SEO
– Other Seo Tools
– All themes and plugins
No settings page. No configuration. Just activate and forget.
Features
- Automatically removes leading whitespace from XML output
- Fixes “XML declaration not at start” errors
- Works with Rank Math, Yoast, and other sitemap plugins
- Compatible with any WordPress theme or hosting
- Runs silently in the background
License
Whitespace Fixer for XML Sitemap is licensed under the GNU General Public License v2 or later.
Installation
- Upload the plugin to the
/wp-content/plugins/directory, or install it via the WordPress Plugin Installer. - Activate the plugin through the ‘Plugins’ menu in WordPress.
- That’s it! Your sitemaps and feeds will now be clean and error-free.
Frequently Asked Questions
No. It only buffers and cleans output whitespace before it reaches the browser. It doesn’t store or alter data.
Not at all. It is compatible with Rank Math, Yoast SEO, All in One SEO, SEOPress, and others.
Ensure no theme or plugin is sending output (like echo, var_dump(), or spaces) before the plugin loads. Also, clear any caching and test again.
No. It’s designed to be automatic. Activate and you’re done.
Review feed
Instantly Fixed My Sitemap Issue
Changelog
1.0.2
- Improved performance by reducing unnecessary output buffering.
- Refactored core cleanup logic for cleaner and more reliable XML output.
1.0.1
- Improved output sanitization to enhance overall security and prevent unwanted data leakage.
- Added stricter header validation before applying whitespace cleanup for safer XML response handling.
- Optimized output buffer handling to ensure better compatibility with caching and SEO plugins.
- Improved performance and reduced risk of accidental whitespace removal in non-XML outputs.
1.0.0
- Initial release
- Automatically removes whitespace before XML declarations


