Add custom post types to your sites main RSS feed

Adding this snippet to the functions.php of your wordpress theme will include the specified custom post types within your primary RSS feed.

function custom_feed_request( $vars ) {
 if (isset($vars['feed']) && !isset($vars['post_type']))
  $vars['post_type'] = array( 'post', 'site', 'plugin', 'theme', 'person' );
 return $vars;
add_filter( 'request', 'custom_feed_request' );

Comments  Leave a Reply

  1. How would you restrict this to a specific taxonomy linked to that custom post type, is this possible?

  2. That’s a great snippet Kevin! I’ve wondered at how that would be done, very nice to see how simple the code is, thanks!

    1. Sweet glad you like it,

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!