{"id":7537,"date":"2009-05-15T18:28:15","date_gmt":"2009-05-15T12:58:15","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=7537"},"modified":"2026-10-13T13:37:01","modified_gmt":"2026-10-13T08:07:01","slug":"wordpress-feed-xml-parsing-errors","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/","title":{"rendered":"Fix WordPress Feed XML Parsing Errors (XML Declaration Not at Start)"},"content":{"rendered":"<p>Is your WordPress RSS feed showing &#8220;<strong>XML Parsing Error: XML or text declaration not at start of entity<\/strong>&#8220;? It happened to us in 2009: our feed stopped loading in every browser and FeedBurner stopped updating, yet Google Reader kept showing our posts, so we only found out when a friend told us. The cause was a blank line before the XML declaration. Here is how to fix WordPress feed XML parsing errors, updated for 2026.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-63487\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error.webp\" alt=\"Fix WordPress feed XML parsing errors\" width=\"1200\" height=\"630\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error.webp 1200w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/fix-wordpress-feed-xml-parsing-error-768x403.webp 768w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> This WordPress feed XML parsing error almost always means something prints output before <code>&lt;?xml<\/code>, usually a blank line or space before <code>&lt;?php<\/code> or after <code>?&gt;<\/code> in your theme&#8217;s functions.php, wp-config.php or a plugin, or a PHP warning. Find it by switching to a default theme and disabling plugins, remove the extra whitespace (and drop closing <code>?&gt;<\/code> tags at the end of PHP files), clear your cache and validate the feed.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6adb14d9d2f6b\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6adb14d9d2f6b\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#What_the_error_looks_like\" >What the error looks like<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#How_to_fix_WordPress_feed_XML_parsing_errors\" >How to fix WordPress feed XML parsing errors<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#What_fixed_it_for_us\" >What fixed it for us<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#Update_services_that_read_your_feed\" >Update services that read your feed<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#Why_does_my_WordPress_feed_show_a_blank_first_line\" >Why does my WordPress feed show a blank first line?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#Does_this_error_hurt_SEO\" >Does this error hurt SEO?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/wordpress-feed-xml-parsing-errors\/#Is_there_a_plugin_to_fix_it\" >Is there a plugin to fix it?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"What_the_error_looks_like\"><\/span>What the error looks like<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Firefox shows the XML parsing error with &#8220;Line Number 2, Column 1&#8221;. Chrome says &#8220;XML declaration allowed only at the start of the document&#8221;. Both mean the same thing: there is something before the first line of the feed.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-7540\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/firefox-feederror.gif\" alt=\"Firefox XML parsing error on WordPress feed\" width=\"468\" height=\"125\" \/><\/p>\n<pre><code>XML Parsing Error: XML or text declaration not at start of entity\r\nLine Number 2, Column 1<\/code><\/pre>\n<h2><span class=\"ez-toc-section\" id=\"How_to_fix_WordPress_feed_XML_parsing_errors\"><\/span>How to fix WordPress feed XML parsing errors<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ol>\n<li><strong>Check the feed.<\/strong> Open yoursite.com\/feed\/ and test it in the <a href=\"https:\/\/validator.w3.org\/feed\/\" target=\"_blank\" rel=\"noopener\">W3C Feed Validation Service<\/a>. If the first line is blank, you have this problem.<\/li>\n<li><strong>Clear caching first.<\/strong> Turn off or purge your caching plugin and CDN so you see the live feed while testing.<\/li>\n<li><strong>Deactivate plugins one by one<\/strong>, or use the <a href=\"https:\/\/wordpress.org\/plugins\/health-check\/\" target=\"_blank\" rel=\"noopener\">Health Check &amp; Troubleshooting<\/a> plugin, which disables plugins only for you without affecting visitors.<\/li>\n<li><strong>Switch to a default theme<\/strong> like Twenty Twenty-Five. If the feed works, the problem is in your theme.<\/li>\n<li><strong>Remove blank lines<\/strong> before the opening <code>&lt;?php<\/code> and after any closing <code>?&gt;<\/code> in functions.php, wp-config.php and plugin files you have edited. The modern best practice is to leave out the closing <code>?&gt;<\/code> at the end of PHP-only files, so stray whitespace can never be sent.<\/li>\n<li><strong>Check for a BOM.<\/strong> Some text editors save files with an invisible byte order mark. Save as &#8220;UTF-8 without BOM&#8221;.<\/li>\n<li><strong>Look for PHP warnings.<\/strong> With WP_DEBUG on and errors displayed, a warning printed at the top breaks the feed. Log errors to a file instead of displaying them on live sites.<\/li>\n<\/ol>\n<h2><span class=\"ez-toc-section\" id=\"What_fixed_it_for_us\"><\/span>What fixed it for us<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Disabling plugins did not help. Over FTP we found blank lines after the closing tags in several files, including wp-config.php, and a blank line at the end of our theme&#8217;s functions.php, which we had edited recently to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/05\/separate-trackbacks-style-comments-in-wordpress-27\/\">separate trackbacks from comments<\/a>. Removing the blank lines fixed the feed instantly.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-7543\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/theme-blankline.gif\" alt=\"blank line at end of theme functions.php\" width=\"182\" height=\"120\" \/><\/p>\n<p>Today, do not edit WordPress core files; update WordPress instead, as current versions do not ship with this problem. Make theme edits in a child theme so updates never undo them.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Update_services_that_read_your_feed\"><\/span>Update services that read your feed<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>After fixing the feed, force services to fetch it again. If you use FeedBurner, see how to <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2012\/02\/fix-feedburner-feeds-not-updating\/\">fix FeedBurner feeds not updating<\/a>. Email newsletter tools and feed readers usually pick up the fix on their next check. Many readers are forgiving and showed our posts even while browsers failed, so check your feed in a browser regularly. Our list of <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2009\/08\/popular-feed-readers\/\">popular feed readers<\/a> shows what your readers may be using.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Why_does_my_WordPress_feed_show_a_blank_first_line\"><\/span>Why does my WordPress feed show a blank first line?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A theme or plugin file outputs whitespace before the feed starts, usually from a blank line around PHP tags.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_this_error_hurt_SEO\"><\/span>Does this error hurt SEO?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Search engines can still crawl your pages, but feed readers, email services and podcast apps may stop updating.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_there_a_plugin_to_fix_it\"><\/span>Is there a plugin to fix it?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Old &#8220;fix RSS feed&#8221; plugins stripped blank lines from PHP files automatically. It is safer to find and fix the actual file.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is your WordPress RSS feed showing &#8220;XML Parsing Error: XML or text declaration not at start of entity&#8220;? It happened&#8230;<\/p>\n","protected":false},"author":4,"featured_media":63487,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"default","_kad_post_title":"default","_kad_post_layout":"default","_kad_post_sidebar_id":"","_kad_post_content_style":"default","_kad_post_vertical_padding":"default","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[49,17],"class_list":["post-7537","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","tag-tutorials","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7537","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=7537"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7537\/revisions"}],"predecessor-version":[{"id":65292,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/7537\/revisions\/65292"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/63487"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=7537"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=7537"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=7537"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}