Change the link URL in default RSS feeds

The question:

My wordpress feeds post item looks following:

   <title>Taste Trail – Lima and Cusco’s Best Eats</title>
   <pubDate>Tue, 16 Apr 2013 03:24:37 +0000</pubDate>
   <guid isPermaLink="false"></guid>

I want to change the URL of the post to something like!view/taste-trail-lima-and-cuscos-best-eats

Please help me with how to do this!


The Solutions:

Below are the methods you can try. The first solution is probably the best. Try others if the first one doesn’t work. Senior developers aren’t just copying/pasting – they read the methods carefully & apply them wisely to each case.

Method 1

You could filter 'the_permalink_rss':

add_filter( 'the_permalink_rss', 'wpse_96602_change_feed_item_url' );

function wpse_96602_change_feed_item_url( $url )
    $parts = parse_url( $url );

    return $parts['scheme'] . '://' . $parts['host'] . '/#!view' . $parts['path'];

But … I strongly recommend not to do that. Hash-bangs will break your web site.

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Comment