{"id":595,"date":"2009-03-09T09:28:22","date_gmt":"2009-03-08T22:28:22","guid":{"rendered":"https:\/\/billmitchell.org\/blog\/?p=595"},"modified":"2009-03-09T09:28:22","modified_gmt":"2009-03-08T22:28:22","slug":"rss-feed-issues-solution","status":"publish","type":"post","link":"https:\/\/billmitchell.org\/blog\/?p=595","title":{"rendered":"RSS feed issues solution"},"content":{"rendered":"<p>\t\t\t\tMy RSS feed came down with a problem recently and began returning the following xml error:<\/p>\n<p>&#8220;XML parsing error: :1:1: xml declaration not at start of external entity&#8221;<\/p>\n<p>How do you deal with this? This blog gives a short tutorial on how to proceed to fix it.<br \/>\n<!--more--><br \/>\nWhile the cause of the problem is straightforward it is a tricky one to solve because it can involve a search for the veritable &#8220;needle in the haystack&#8221;. The problem arises because there is a blank line (or space) either before or after the <? ?> declarations in php in <strong>one<\/strong> of your templates. It seems to be a common problem and arises from not being careful when editing a file to clean out all blank lines &#8211; most likely at the end of the file (that is, outside the closing ?> php tag) &#8211; and brought about, for example, by just hitting the enter key once.<\/p>\n<p>If the problem has just arisen then it might be a template you edited in the last 24 hours. If you have access to your shell (in linux) then type the following to see which templates you have edited<\/p>\n<p><code>find . -mtime -1 -name \\*.php<\/code><\/p>\n<p>This command will return a list of relevant files and if it does then you can check them individually for the problem.<\/p>\n<p>If that doesn&#8217;t help (perhaps because the problem is more than a day old) and you cannot remember which files you have been editing then it is a fair bet that it will be in one of the configuration templates (if you are using WordPress templates) &#8211; wp-rss.php, wp-atom.php, wp-config.php or in one of the theme templates (very likely the functions.php file).<\/p>\n<p>Go to the excellent RSS Feed validator &#8211; <a href=\"http:\/\/feedvalidator.org\/\">http:\/\/feedvalidator.org\/<\/a> to run a diagnostic which gives some clue.<\/p>\n<p>In my case I had edited the functions file in the theme I built (billy_blue) and at the end of the file was a blank line. Fixed with a minimum of fuss. But this can be a taxing problem if you have been doing a lot of editing to build or change a site.<\/p>\n<p>Hope this helps people in a similar situation zero in on the problem.<\/p>\n<p>best wishes<br \/>\nbill<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My RSS feed came down with a problem recently and began returning the following xml error: &#8220;XML parsing error: :1:1: xml declaration not at start of external entity&#8221; How do you deal with this? This blog gives a short tutorial on how to proceed to fix it.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[5,36],"tags":[],"class_list":["post-595","post","type-post","status-publish","format-standard","hentry","category-admin","category-linux","entry","no-media"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/595","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=595"}],"version-history":[{"count":0,"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=\/wp\/v2\/posts\/595\/revisions"}],"wp:attachment":[{"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/billmitchell.org\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}