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

How to include Related Posts in WP RSS feed not use plugin? I have search around on google and stackexchange but have no result about this. Thanks all friends!

share|improve this question
Do you mean how to compute related posts or how to place them in feed when they are already computed? – Krzysiek Dróżdż Jun 20 '13 at 8:01
Yes! I want to place them in feed. – Zen Nguyễn Jun 20 '13 at 16:48
up vote 0 down vote accepted

You have to use the_content and the_excerpt_rss hooks. You can do this like this:

function rss_append_footer($content) {
    if(is_feed()) {
        $related_posts_html = ...  // I assume you already can compute it
        $content .= $related_posts_html;
    return $content;

add_filter('the_content', 'rss_append_footer');
add_filter('the_excerpt_rss', 'rss_append_footer');
share|improve this answer
Thank you very much @Krzysiek Dróżdż. – Zen Nguyễn Jun 21 '13 at 2:22

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.