the RSS feed of annuncistar.it isn't valid because the "&" char is not allowed in RSS feeds. In or开发者_开发问答der to solve that issue I've added a WordPress filter in my functions.php file.
function mp_permalink($permalink) {
$url = str_replace("&", "&", $permalink);
return $url;
}
add_filter('the_permalink_rss', 'mp_permalink');
Unfortunately this function doesn't work. What could the reason be?
Your feed URL seems to have Google Analytics tracking variables (utm_source, etc.) appended to it. Normally, a WordPress feed URL looks as simple as (to take mine as an example):
http://gothick.org.uk/feed
However, with Analytics tracking variables, it looks something like this:
http://gothick.org.uk/?utm_source=source&utm_medium=medium&utm_term=term&utm_content=content&utm_campaign=campaign
So, I'm guessing that you have a plugin installed that is altering your feed URL to add these variables. Unfortunately, when it's being embedded in your RSS feed as the feed source, the ampersands in the URL aren't being escaped -- I'd guess this is a bug in the plugin.
I'd guess your filter isn't being run after the plugin changes the original feed. Whether that's because it's being run earlier in the filter chain or because the analytics plugin is targeting the feed URL at a different level, I'm not sure.
Either way, the solution will be to disable the analytics plugin, or at least the bit that alters the feed URL, or update it to a version that escapes the URL properly for use in the RSS feed XML.
精彩评论