Modify XML feeds in WordPress RSS feeds


I have needed to modify the <link> attribute of an individual RSS item. here is the code I am currently running but this adds another <link> on the end of each RSS2 item.

function modify_rss_feed()
    $output = '<link>' . $mynewlink . '</link>;
    echo $output;
add_action('rss2_item', 'modify_rss_feed');

An example XML <item> may look like this

<title>This is a title link</title>
<pubDate>Sun, 03 Nov 2019 18:44:00 +0000</pubDate>

How am I able to modify the existing fields in the RSS output at, etc.

, , Shwmae 4 years 2019-11-05T07:13:59-05:00 0 Answers 73 views 0

Leave an answer