How to Make a Separate RSS Feed for Each Custom Post Type in WordPress
-
by cobra_admin
- 30
Do you want to make a separate RSS feed for each custom post type on your WordPress website?
Custom post types allow website owners to add their own unique content types. These post types can have similar features to posts or pages, including an RSS feed.
In this article, we will show you how to easily make a separate RSS feed for custom post types in WordPress.

Creating Separate RSS Feeds for Custom Post Types in WordPress
By default, WordPress generates several RSS feeds for your website.
For instance, all your recent blog posts appear in your site’s main RSS feed. This feed can be accessed by adding /feed/ to your domain name like this:
https://example.com/feed/
What most beginners don’t know is that WordPress generates separate RSS feeds for different archive pages of their websites.
For instance, it has separate RSS feeds for categories, tags, authors, and custom post types.
Let’s say you have a custom post type called movies on your website. You can view all content created in that post type by visiting the post type archive page:
https://example.com/movies

To view the RSS feed, all you need to do is add /feed/ next to the custom post type archive URL.
https://example.com/movies/feed/

Alternatively, you can also view the feed by adding the post type parameter to your main WordPress RSS feed. For example:
https://example.com/feed/?post_type=movies
This URL will then only fetch the custom post type called movies.

Add a Link to Custom Post Type RSS Feed
Now that you know how to access the RSS feeds for any custom post type on your WordPress website, you can use that URL to create links to your custom post type feeds.
For instance, you may want to display an icon or a plain text link on the custom post type archive page so that your visitors can easily subscribe to those posts.
The easiest way to do this is by creating a separate template for your custom post type in your WordPress theme.
For instance, if your custom post type is called movies, then you can create an archive-{post_type}.php
file in your WordPress theme.
After that, you can simply copy the contents from your theme’s archive.php template and start customizing your new template.
You can simply add a plain HTML link to your post type archive feed using the following code:
1 | < p >< strong >Subscribe to: < a href = "https://example.com/movies/feed/" >Movies</ a ></ strong ></ p > |
Hosted with ❤️ by WPCode
1-click Use in WordPress
Don’t forget to change the URL to your own post type feed URL.
Now, the problem with this code is that you will have to create a new template file just for that particular post type.
This next method will allow you to dynamically generate the post type RSS feed link for all your archive pages.
1 2 3 4 | <?php if ( is_post_type_archive() ) { $post_type = get_post_type( get_queried_object_id() );?> <p><strong>Subscribe to: <a href="<?php echo get_post_type_archive_link( $post_type ); ?>feed/"><?php post_type_archive_title(); ?></a></strong></p> <?php } ?> |
This code will simply add a link below the post type’s archive page title, encouraging users to subscribe to this particular content type.

Bonus Tip: Add Custom Post Type to Your Main RSS Feed
Custom post type RSS feeds are not easily discoverable by feed readers, and most of your users may find your site’s RSS feed more easily.
This means that users subscribed to your main RSS feed will miss out on the content you publish in your custom post type.
You can easily fix this by adding content from your custom post type to appear in your site’s main RSS feed.
To do that, you will need to add a custom code snippet to your WordPress blog. We recommend using WPCode to add custom code snippets in WordPress.
First, you need to install and activate the free WPCode plugin. For more details, see our article on how to install a WordPress plugin.
Once the plugin is activated, visit the Code Snippets » + Add Snippet page from the WordPress admin sidebar.
From here, you need to click the ‘Use Snippet’ button under the ‘Add Your Custom Code (New Snippet)’ option.

You will now be directed to the ‘Create Custom Snippet’ page, where you can start by typing a name for your code snippet.
This name won’t be displayed anywhere and is just used for identification purposes.
Next, choose the ‘PHP Snippet’ option from the ‘Code Type’ dropdown menu on the right.

After that, you are ready to add your custom code snippet.
Simply copy and paste the following code into the Code Preview box.
1 2 3 4 5 6 | function myfeed_request($qv) { if (isset($qv['feed']) && !isset($qv['post_type'])) $qv['post_type'] = array('post', 'movies', 'books'); return $qv; } add_filter('request', 'myfeed_request'); |
After adding the code, type the name of the custom post type next to where ‘[‘post_type’]’ is written in the code. In our example, we have ‘post’, ‘movies’, and ‘books’.
This custom post type will be added to your main WordPress RSS feed.

Next, you need to scroll back to the top of the page and toggle the ‘Inactive’ switch to ‘Active’.
Finally, don’t forget to click the ‘Save Snippet’ button to save and execute the code on your WordPress website.

That’s all, your custom post type content will now be added to your site’s main RSS feed.
We hope this article helped you learn how to create a separate RSS feed for custom post types in WordPress. You may also want to see our tutorial on optimizing your WordPress RSS feeds and our expert picks for the best WordPress RSS plugins.
Do you want to make a separate RSS feed for each custom post type on your WordPress website? Custom post types allow website owners to add their own unique content types. These post types can have similar features to posts or pages, including an RSS feed. In this article, we…
Do you want to make a separate RSS feed for each custom post type on your WordPress website? Custom post types allow website owners to add their own unique content types. These post types can have similar features to posts or pages, including an RSS feed. In this article, we…