Support » Fixing WordPress » Feeds not served as xml

Viewing 12 replies - 1 through 12 (of 12 total)
  • Mine passes validation, so your issue must be either plugin or server related, probably the 2nd. In what way, not a clue. 😐

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Try disabling all of your active plugins, then check your feed’s validation again.

    Mmm, you’re right, a plugin could be sending a header or spitting out a space or something.

    Thread Starter sitapati

    (@sitapati)

    Here’s the first few lines of wp-rss2.php:

    <?php

    if (empty($wp)) {
    require_once(‘wp-config.php’);
    wp(‘feed=rss2’);
    }

    header(‘Content-type: text/xml; charset=’ . get_settings(‘blog_charset’), true);
    $more = 1;

    ?>
    <?php echo ‘<?xml version=”1.0″ encoding=”‘.get_settings(‘blog_charset’).'”?’.’>’; ?>

    The xml version line is output, but the header line is not, which is why feedvalidator complains about it being sent as text/html. At the same time two blank lines are put into the feed.

    Any ideas on why? My php-fu is pretty weak.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Did you “try disabling all of your active plugins, then check your feed’s validation again”?

    sitapati – your error has nothing to do with plugins or anything you can actually do. This error is reported here infrequently (I would say most people do not validate their feeds) and it quite literally goes away all on it’s own.
    It’s more than likely – as Viper007bond has said – to be a server related issue but despite the best efforts of people who have had this, no-one seems able to pin down the precise and consistent cause.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Podz, most of the time that I have seen that error reported here, it has been due to an extra blank line either at the top or bottom of a plugin file or a core WordPress file. I always suggest the plugins first, because their on/off switch make them easy to troubleshoot.

    I. If it were a core file, then every feed would be invalid, the problem identified and cured.

    2. If it were a plugin, then that too would be identified.

    Some very knowledgeable forum members who know their way around servers / php and validation extremely well have faced this issue and did not discover the cause.

    Moderator James Huff

    (@macmanx)

    Volunteer Moderator

    Every time I have dealt with this, it was usually related to someone poking around in a file where they shouldn’t or an FTP editor adding something to the file as it uploads. Basically, this is the syndicated feed’s version of “headers already sent” (explain how that one happens all the time).

    Sorry, but every time I have handled one of these cases, it has been related to an extra blank line in either a plugin or core file. I guess that we have both seen two similar, yet different, issues.

    I wouldn’t rule out either personally.

    I just had this problem and have identified what caused it.

    Checked the feed validator and it said this:

    Sorry, This feed does not validate.

    line 1, column 1: XML parsing error: <unknown>:1:1: xml declaration not at start of external entity

    As macmanx advised, I turned off all my plugins and then tried it again. Bingo, it worked! I installed two plugins yesterday so switched on everything except those two and the feed still validaed.

    In the end it turned out to be Ozh’s WordPress Admin Drop Down Menu

    Thread Starter sitapati

    (@sitapati)

    Thanks for the tips guys. I did the elimination of the plugins, and it turned out to be Elliot Back’s WordPress Hashcash.

    Word!

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Feeds not served as xml’ is closed to new replies.