Do you want to create a distinct RSS feed for each of your WordPress website’s custom post types?
Website owners can use custom post types to create their own unique content types. These post types may include functionality comparable to posts or pages, such as an RSS feed.
Using WordPress to Create Separate RSS Feeds for Custom Post Types
WordPress creates many RSS feeds for your website by default.
For example, your primary RSS feed includes all of your most current blog posts. By adding /feed/ to your domain name, you can access this feed:
Most newcomers are unaware that WordPress creates distinct RSS feeds for each of their website’s archive pages.
It offers RSS feeds for categories, tags, authors, and custom post kinds, for example.
Let’s imagine your website has a custom post type named movies. By visiting the post type archive page, you may see all of the content generated in that post type.
To read the RSS feed, simply append /feed/ to the end of the custom post type archive URL.
You can also access the feed by including the post type option in your regular WordPress RSS feed. Consider the following scenario:
This URL will only provide results for the movies custom post type.
Add a link to the RSS Feed for Custom Post Types
You may use that URL to generate links to your custom post type feeds now that you know how to access the RSS feeds for any custom post type on your website.
For example, on the custom post type archive page, you could wish to include an icon or a plain text link so that visitors can quickly subscribe to those posts.
The simplest approach to achieve this is to create a separate template in your WordPress theme for your custom post type.
Create an archive-post type.php file in your WordPress theme if your custom post type is called movies, for example.
After that, you can start customizing your new template by copying the data from your theme’s existing archive.php template.
Using the following code, you can easily add a plain HTML link to your post type archive feed:
Remember to replace the URL with your own post type feed URL.
The issue with this code is that you’ll have to develop a new template file specifically for that post type.
The next approach allows you to construct the post type RSS feed link for all of your archive pages dynamically.
Simply paste the following code into the archive.php template file of your theme.
This code will simply add a link to the archive page title of the post type, urging people to subscribe to that content kind.
We hope this article demonstrated how to build a distinct RSS feed in WordPress for custom post kinds. You might also be interested in our WordPress guide on how to create an email subscription form or our WordPress RSS feed optimization recommendations.