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 have a few extra custom fields added into a user's profile and output them in several places within the frontend. One thing I want to do is add some of those custom fields into the WordPress Feed as RSS elements. As an example, I know that the Author Display Name is output by default but also want to add their Twitter handle into the feed too.

Anyone know a solution to this? Thanks

share|improve this question

Check out either the the_content_feed and the_excerpt_rss filters or use the regular content and excerpt filters with the is_feed conditional function.

The following should get you on the right track:

function wpse_140401_add_to_feed( $content )
    $twitter_handle = /* grab handle */;

    if ( is_feed() ) {
        $content .= '<p>' . $twitter_handle . '</p>';

    return $content;
add_filter( 'the_excerpt_rss', 'wpse_140401_add_to_feed' );
add_filter( 'the_content_feed', 'wpse_140401_add_to_feed' );

Note that given the fact that the above uses filters applied to feeds only, the conditional isn't strictly necessary.

share|improve this answer

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.