WordPress.org

Ready to get started?Download WordPress

Forums

Incorrect generation of RSS feeds (6 posts)

  1. Echo
    Member
    Posted 9 years ago #

    There seems to be a bug in the generation of the RSS 2 feed that prevents it from being completely valid -- feedvalidator.org complains about "undefined description elements" in the description node of an item entry; namely HTML tags.
    I think the description node is supposed to be just text/plain, meaning it needs to be wrapped in a CDATA tag for it to be valid. WordPress 1.2.2 doesn't do this.
    It's easy enough to fix in my own WP installation, but it would be helpful if it's fixed in WP proper as well.

  2. James
    Happiness Engineer
    Posted 9 years ago #

    It's working just fine in everyone else's install, just validate mine, it's fine. For you, I would say delete wp-rss2.php and wp-feed.php off of your server (this is a critical step, do it). Download WP again (this is also a critical step, do it). And, upload a fresh wp-rss2.php and wp-feed.php from your new download. You will probably have to make a new post to see any changes, but that should do the trick.

  3. Echo
    Member
    Posted 9 years ago #

    The files uploaded to my server match the checksum of those in the WP 1.2.2 zip file. Re-downloading would accomplish nothing.
    WP simply generates incorrect RSS.
    Yours is validating because you only have a summary in your RSS.

  4. James
    Happiness Engineer
    Posted 9 years ago #

    Just try replacing the files. Like I said before, you're the only one with this problem.

  5. Echo
    Member
    Posted 9 years ago #

    The MD5 sums straight from the zip matched, but I replaced anyway. No deal.

  6. Anonymous
    Unregistered
    Posted 9 years ago #

    I think it might because some plugins are used the following lines in wp-rss2.php fails :
    <?php if (get_settings('rss_use_excerpt')) : ?>
    <description><![CDATA[<?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?>]]</description>
    <?php else : ?>
    <description><![CDATA[<?php the_excerpt_rss(get_settings('rss_excerpt_length'), 2) ?>]]</description>
    <content:encoded><![CDATA[<?php the_content('', 0, '') ?>]]></content:encoded>
    <?php endif; ?>
    I added the CDATA in for both of the description tags

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.