As I mentioned in my last post, I’m using FeedWordpress to syndicate affiliate links. I turned on the option to have the permalink to the affiliated articles to go straight to the affiliate link instead of the page (that may be bad for SEO, but one less click for visitors).
The problem was the RSS feed became invalid because of the affiliate link. So I need to encode the link. So on line 590 of feedwordpress.php, I changed
$uri = get_syndication_permalink();
$uri = esc_attr(get_syndication_permalink());
The esc_attr function is a built in WordPress function that converts certain characters to their HTML encoded equivalents. Such as “&” becomes “&”.
Everything seems to be working fine now.