3

I need to change the title of the feed that appears in the top in mywebsite.com/feed. I have tried editing files in wp-includes and also have tried this code :

 function filter_wp_title_rss( $get_wp_title_rss, $deprecated ) { 
    // make filter magic happen here... 
    return 'new title'; 
}; 

// add the filter 
add_filter( 'wp_title_rss', 'filter_wp_title_rss', 10, 2 ); 

But this does not work.

1
  • At first look this code looks OK. Maybe some plugin is overwriting your change? Check the filter priority?
    – Picard
    Commented Jul 12, 2017 at 13:11

1 Answer 1

2

In functions.php of theme:

add_filter( 'wp_title_rss', 'my_rss_filter', 20, 1 );

function my_rss_filter( $rss_title ) {
    $rss_title = 'New Title';
    return $rss_title;
}

I added a lower priority of 20, and just ditched the deprecated stuff altogether. You could just return a text string as you have it, of course, but I included the rest for a more complete reference.

1
  • 1
    This seems to change the title of all feeds. e.g. I have a feed at /feed/podcast/ created by the Blubrry plugin, and this is changing its feed title too.
    – ngm
    Commented May 15, 2018 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.