Comments Feed Fix

Again my RSS comments were broken for the past few days. After realizing that many of my friends were having this same issue I finally grew tired of it and looked for the root of the problem along with a solution. What I learned was that special characters in comment titles were rendering my xml feeds invalid. For some reason the content of the comments is surrounded in <![CDATA[ stuff ]]> but the title isn’t. The simple fix I found was to just wrap the title contents in <![CDATA[ stuff ]]>.

File: wp-commentsrss2.php
Before: <title>by: <?php comment_author_rss() ?></title>
After: <title><![CDATA[by: <?php comment_author_rss() ?>]]></title>

I’m not sure if this is the best way to solve this problem, but it seems to have worked for now. Hopefully this will help others with broken feeds.

Leave a Reply