Gloss & Stripes

About Programming, Mac, Design and Everything that’s somehow Arty or Open Source.

If you have encountered feed validation errors with Wordpress plugins you may find this useful.

1. The problem

The problem you may know is that an advanced Wordpress installation (say: having many plugins and customized pages installed) can results in an invalid Feed-Validation like this:

This feed does not validate.
line 1, column 1, XML parsing error: 1:1: xml declaration not at start of external entity

^

The Feedvalidator returns a XML Parsing Error marking a whitespace before the first xml-tag. Nobody knows where this comes from…right?

2. The source

wp-plugin file…may be in any of your Wordpress Plugin files. The XML-Feed Validation error simply results from leading or trailing whitespaces in any of your wp-plugin’s *.php file.

3. The solution

To fix the validation error switch off your plugins one by another to see in which script the bug is in. (switch off>validate…etc.)
If you spotted the ‘buggy’ plugin-file check it for leading or trailing whitespace before and after the -Tags. Simply delete them with a text-editor of your choice and also make sure that there aren’t any blank lines outside the script tags.

4. Validation

When the work is done you will be rewarded with a valid feed.

[Valid RSS]
Congratulations!

This is no big deal, but I think this only happens because users create these files from scratch in a text-editor just by pasting selected php-code from a plugin’s webpage or customizing the plugin a bit (assuming the plugin is originally well-formatted).

So take care of your whitespaces. Hope this helps.

Posted in Wordpress, Tags:, ,

Possibly Related Entries

4 Responses to “Wordpress plugins causing feed errors”

  1. kelet said

    Thanks a lot.I finally settled this problem as you wrote here.And the bug plugin is TechnoTag which has white space after the end

  2. I’ve spent about 3 hours yesterday trying to fix this very issue.

    After that I’ve decided to code up a general solution for those leading whitespace problems.

    Maybe you’ll find that script helpful:
    http://wejn.org/stuff/wejnswpwhitespacefix.php.html

Post a comment or review the article

+ -

Eine Seite

freshlabs journal is the bi-lingual weblog and digital playground of Tim Isenheim, designer and webdeveloper from Hamburg, Germany. More →

  • Download Summersun, a sunny theme for WordPress
  • Download WP SIMILE Timeline, a lifestream plugin for WordPress

Topics

Archives

Tag Cosmos

Full Tag Cloud