Tech Dreams

Fixing WordPress RSS Issue “XML Parsing Error: XML or text declaration not at start of entity”

wordpress_logoToday we noticed that Tech Dreams RSS feed was not working and showing an error when tried to access it.

The error message is something to do with invalid XML format of the feed. The exact error displayed on the screen is

XML Parsing Error: XML or text declaration not at start of entity / Error on line 2: The processing instruction target matching" [xX] [mM] [IL] "is not allowed

Location: http://feedproxy.google.com/td

Line Number 2, Column 1:<?xml version="1.0" encoding="UTF-8"?>

Cause

After a bit of research on the net, I understood that reasons for the error are the blank spaces keyed into the php pages. The trailing and leading blank spaces in few php files of WordPress setup resulted due to editing of theme files is the main reason for this issue. 

Fixing The Issue

Looks like many people often face this issue and few good guys at http://www.flyaga.info created a WordPress plugin to fix this issue with a single click. Otherwise we may have to edit many php files to remove the blank spaces.

To fix the issue

  1. Install and activate the fix-rss-feed plug-in
  2. Go to Admin –> Setting -> Fix RSS Feed
  3. Click on the "Fix WordPress RSS Feed" button
  4. After the fix job is completed, your WordPress feed should be up and running

Happy Blogging!!