XML Parsing Error in Firefox; Cannot Display This Feed in IE

This article describes, how to fix RSS Feed error messages in WordPress.

In Firefox the error is “XML Parsing Error”.  In IE you see “Internet Explorer cannot display this feed”.

 

Symptoms

When you click on RRS link in WordPress (or bbPress), you are getting this error message (see images bellow).  The message is different depending on your browser.

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

Location: http://www.domainwebcenter.com/wp-content/bbpress/rss.php?topic=29

Line Number 4, Column 1:<?xml version=”1.0″ encoding=”UTF-8″?>

 

Internet Explorer cannot display this feed 

This feed contains code errors.

Go back to the previous page.

More information

Invalid xml declaration.
Line: 4 Character: 3

<?xml version=”1.0″ encoding=”UTF-8″?>

 

Solution

Look at the page source code in the browser, and see how many blank lines you have at the top of the page:

 

These blank lines on your HTML page source code could appear  from blank lines between PHP  tags in your WordPress theme functions.php file:

The problem here is the white space between PHP tags, not the space inside PHP code.    To fix the problem, remove that blank space, or better yet make it one PHP tag.

Reload your WordPress page and see, if any blank lines remain at the top.  If yes, continue the search.  Even white space after the last PHP tag needs to be removed.

You also might have a custom “functions.php” in your bbPress template.    That file also should be checked for white space.  If you wrote some custom plug-ins, check the code there as well.

(Visited 1,410 times, 1 visits today)

1 Comment

  1. Is there a way to batch through your files and remove all the spaces. Maybe like html tidy or something of that nature. Apply source formatting seems to do it in dreamweaver, but only one file at a time.

Your question, correction or clarification Ваш вопрос, поправка или уточнение