How to Make a Separate RSS Feed for Each Custom Post Type in WordPress (Step-by-Step)

As a webmaster with over 15 years of experience, I know that RSS feeds are incredibly useful for publishers and readers alike. RSS allows your visitors to subscribe to your content and get notified when you publish new posts.

But did you know that you can create separate customized RSS feeds for each of your custom post types?

In this post, I‘ll explain step-by-step how to access, create, and optimize RSS feeds for your custom post types in WordPress. Whether you want to provide more focused content to your readers or improve organization, separate RSS feeds can help.

Why You Should Consider Separate Feeds for Custom Post Types

Before we dig into the how-to, let me explain a few of the benefits that separate RSS feeds offer:

Curated Content for Readers

Your readers can subscribe only to the content they are interested in. For example, if you have a podcast, visitors can subscribe to just the podcast episodes.

According to 2022 statistics from HubSpot, 78% of consumers want content tailored to their interests. Separate feeds allow you to deliver focused content.

Organization and Readability

Separating your content into different feeds improves the organization and consumption experience.

For example, seeing blog posts and podcast episodes mixed together can be confusing. Separate feeds create clearer divisions.

Discoverability for Custom Post Types

Feeds increase discoverability. But custom post types don‘t automatically appear in your main RSS feed.

By creating a separate feed, you make that content more findable for readers.

Customization Options

You can customize settings like number of feed items for each post type‘s feed. For example, you may show 50 latest podcasts but only 10 blog posts.

Step 1: Find the Feed URL for a Custom Post Type

Every custom post type in WordPress automatically has its own RSS feed. So the first step is accessing the URL for your custom post type feed.

Let‘s say you have a custom post type called "podcast":

  1. Go to the archive page for the post type, usually yoursite.com/posttypename (like yoursite.com/podcast)

  2. Add /feed/ to the end of the URL.

For our example, the podcast feed URL would be:

yoursite.com/podcast/feed
  1. Alternatively, you can add ?post_type= to your main feed URL like this:
yoursite.com/feed/?post_type=podcast

That‘s all you need to access the RSS feed for any custom post type!

Step 2: Add a Link to Your Custom Post Type Feeds

Now that you can access the feed URL, the next step is adding a visible link on your site to help readers discover and subscribe to that feed.

Let me share a few different options for adding links:

1. Create a Custom Archive Template

The simplest method is to create a custom archive template for that post type and add a link directly in the template code.

For example, make a file called archive-podcast.php and add:

<p>
  <strong>Subscribe to our podcast:</strong>
  <a href="<?php echo get_post_type_archive_link( ‘podcast‘ ); ?>/feed/">Podcast Feed</a>
</p>

This will display the link on all podcast archive pages.

2. Add to Your Main Archive Template

To display links for ALL post types automatically, use this code in archive.php:

// Check if archive page
if ( is_post_type_archive() ) {

  // Get post type
  $post_type = get_post_type( get_queried_object_id() ); 

?>

<p>
  <strong>Subscribe to: </strong>
  <a href="<?php echo get_post_type_archive_link( $post_type ); ?>/feed/">
    <?php post_type_archive_title(); ?> Feed
  </a>
</p>

<?php } ?>  

This dynamically gets the post type and title to display the link.

3. Use a Feed Plugin

For more options like adding icons and advanced settings, use a plugin like Custom Feeds.

The plugin lets you fully customize and display the feeds directly on your site.

Step 3: Add Custom Post Types to Your Main Feed

One thing to note is that your main RSS feed only includes standard posts by default. Custom post types won‘t appear in that feed.

To fix this and increase discoverability, you can add custom post types to your main feed using the following code:

function add_custom_posts_to_feed( $query ) {
  if ( $query->is_main_query() && $query->is_feed() ) {
    $query->set( ‘post_type‘, [‘post‘, ‘podcast‘] );
  }
}
add_action( ‘pre_get_posts‘, ‘add_custom_posts_to_feed‘ ); 

This will include both regular posts and the "podcast" custom post type in your main feed.

Why Separate Feeds are so Valuable

As you can see, it only takes a few steps to access and create separate RSS feeds for your custom post types in WordPress.

But the benefits make it more than worthwhile:

  • Curated content – Let readers subscribe only to what interests them.

  • Organization – Each feed presents focused and relevant content.

  • Discoverability – Feeds showcase your custom post types to subscribers.

  • Customization – Set individual options for each feed.

Take the time to leverage separate RSS feeds, and you can take your content strategy to the next level!

Let me know if you have any other questions on implementing custom RSS feeds for post types in WordPress. I‘m happy to help you start benefiting from this useful feature.

Written by Jason Striegel

C/C++, Java, Python, Linux developer for 18 years, A-Tech enthusiast love to share some useful tech hacks.