WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to optionally replace some RSS item titles with a headline meta field I've added to certain post types.

I have the post types showing up in the feed using:

function myfeed_request($qv) {
  if (isset($qv['feed']) && !isset($qv['post_type']))
    $qv['post_type'] = array('post', 'interviews', 'reviews');
  return $qv;
add_filter('request', 'myfeed_request');

But I've searched around and can't figure out how to replace the title. Any ideas?

share|improve this question
up vote 3 down vote accepted

Something like this (not tested):

add_filter('the_title_rss', 'custom_feed_title');

function custom_feed_title($title) {

    $headline = get_post_meta(get_the_id(), 'headline', true);

    if (!empty($headline))
        return $headline;

    return $title;
share|improve this answer
Perfection. Thanks! :o) – robalan Mar 5 '11 at 21:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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