Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Make a Separate RSS Feed for Each Custom Post Type in WordPress

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’ll show you how to easily make a separate RSS feed for custom post types in WordPress.

Making 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:

https://example.com/feed/

What most beginners don’t know is that WordPress generates separate RSS feeds for different archive pages of their website.

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

Example of a custom post type archive page

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/

Custom post type RSS feed in WordPress

Alternately, 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.

Alternate custom post type RSS feed URL

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 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 existing 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:

<p><strong>Subscribe to: <a href="https://example.com/movies/feed/">Movies</a></strong></p>

Don’t forget to change the URL to your own post type feed URL.

Now, the problem with this code is that you’ll 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.

Simply add the following code to your theme’s archive.php template file.

<?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.

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 how to add an email subscription form in WordPress or check out our tips on optimizing your WordPress RSS feeds.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

29 CommentsLeave a Reply

  1. Is there way to create RSS feed for single page ?
    Ex – example.com/single-post-type/single-post-name

    How to create RSS for this ?

    • RSS feeds are for listing multiple posts, the RSS would include a link to the post itself. We would not recommend creating a specific RSS feed for one post or page.

      Admin

  2. Hey, and do you know any rss wordpress plugin for visitors ? As big new companies have own RSS creator to put rss on some freelancer sites, I want to it same, but not with post but with custom post types….do you know some RSS plugin ?

  3. It still doesn’t work for me – I’m trying to display an RSS Feed for the content on this page –

    and displays the RSS feed for all of my posts. Any thoughts?

      • Thank you for the response. I’m sorry for the confusion as it looks like my links didn’t appear. The posts that appear on that page are custom posts (it’s like the blog roll but for custom posts), but the method to do the RSS feed didn’t work for me. Any thoughts or suggestions?

        • Hey Tori,

          If you are certain that the posts belong to a custom post type, then you need to find out the name used by the custom post type. You can do that by clicking on the custom post type menu item in your WordPress admin sidebar. Clicking on it will take you to an admin page listing all the posts in that post type. Now if you look into the browser address bar you will see something like this:

          http://www.example.com/wp-admin/edit.php?post_type=your_post_type

          The part that appears after the post_type= is your custom post type name. Now you need to use this to reach the RSS feed URL for that custom post type.

          http://www.example.com/feed/?post_type=your_post_type

          Hope this helps.

    • Thank you for the response. When I do that, I see this error message — any thoughts?

      ______

      This page contains the following errors:

      error on line 2 at column 1: Extra content at the end of the document
      Below is a rendering of the page up to the first error.

  4. Hi and thanks for this !

    I would like to add custom fields for my custom post type feed (not for the regular posts, only for my custom post type).

    How could I do that ?

    Thanks a lot !

  5. I’ve gotten this to work but it limits the posts in the rss feed to 10 when I feedburn it. Is there any way to create a full rss feed for custom post types without limiting the quantity of posts it pulls in?

  6. Hi there. Could you tell me how to create a feed for all post types, so someone can signup to a single RSS feed for all posts on the site, regardless of which post type they are in?

  7. THANK YOU VERY MUCH, i was looking for this info for 2 hours. Glad i found your info. Fu…. taxonomy, where were you?!! aahhh!
    Work so fine now

  8. it works for me and I love you for it. I created a link to each pos type I’ve got, but in the RSS reader they are all called the same, any way I can affect the title of the feed to reflect the post type?

  9. If I am using a slug re-write for the taxonomy that wouldn’t make a difference and be causing the problem would it? I’ve tried both ways and it doesn’t work either way, with the actual registered taxonomy title or the slug.

  10. I can’t seem to make that work. It only takes me back to the custom post type archive page again.

    Btw, I use Custom Post Permalinks plugin to allow custom post type permalinks and archive pages. Could that have created the issue??

    Cheers!

    • Oops, sorry.. it was my theme’s problem. I had an action call to redirect anything that is related to custom post types, thus the redirection of the feeds. But got it fixed now.

Leave a Reply to gabearnold Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.