WordPress feed: how to fix “XML Parsing Error: XML or text declaration not at start of entity”

Are you encountering an XML parsing error in your WordPress feed?

This could be a very easy fix if you’re getting this message:

XML Parsing Error: XML or text declaration not at start of entity

Location: http://www.YOURSITE.com/feed/
Line Number 2, Column 1:Example functions.php file:

xml parse error reason

It might be another theme file, but functions.php is typically the file that is edited to add custom code, and that’s where a blank line can sneak in and mess up your feed. If you see blank line(s) outside the PHP code, delete them and that should fix the problem.

I’ve run into this multiple times and this has always been the case. Hopefully it helps someone else find and fix their XML Parsing Error.

John Holt

I’m a software engineer and web designer in Fort Pierce, Florida (winter) and Franklin, New Hampshire (summer). Super Blog Me is a space where I can brainstorm my ideas on WordPress development, interface design and other things I do with my life.

Leave a Reply

Your email address will not be published. Required fields are marked *