Separate RSS Feed for Each Category in WordPress

How to Make a Separate RSS Feed for Each Category in WordPress

Would you like to make a separate RSS feed for each category in WordPress?

In WordPress, categories help sort and group your content into different sections.

Adding RSS feeds for each category can help your users subscribe to specific areas of interest on your website.

This tutorial will share how you can easily make a separate RSS feed for each category in WordPress and how you can utilize them.

Finding RSS Feed for Categories in WordPress

Categories allow you to sort and organize your content into different topics/ headings.

In WordPress, each category has its own RSS feed by default. You can find this RSS feed by adding ‘feed’ at the end of the category page URL.

Like, if you have a category named ‘News’ with a URL shown below:

https://example.com/category/news/

So, You can find its RSS feed by adding the feed at the end of its URL:

https://example.com/category/news/feed/

Note: You can get your category URL by heading over to the Posts » Categories page and selecting the View link next to the category.

Show Your Category RSS Feed Links in WordPress

After locating the RSS feed URLs for your categories, We must find ways to share them with your visitors on your WordPress site.

1. Adding Links to Category RSS Feeds in WordPress

Adding a link to the category feed is the easiest way to point users to a category RSS feed.

For this, edit the post/ page and add a plain text link anywhere you like.

This method can manually create a list of links to all your category RSS feeds.

But, if you add, merge or delete categories in the future, you will have to update that list manually.

Therefore, you must find a way to update the category RSS feeds list automatically. Let us tell you how you can do that. 

2. Display a List of Category Feeds Manually

With this method, you can display a categories list with links to the category-specific RSS feed. The best thing about this method is the list will automatically update if you add or remove any category on your site.

For this, You have to add some custom code to your WordPress site.

To start, you have to find an image that you can use as the RSS feed icon. For now, we are using the RSS feed icon with 32×32 pixels in dimensions.

Then, you have to upload the image to your website. Visit the Media » Add New page to upload your image and then click the ‘Copy URL to Clipboard’ option.

Now, paste the image URL in any plain text editor like Notepad or TextEdit. You will need this later.

Next, copy the code and paste it to your theme’s functions.php file or a site-specific plugin.

 function wpbeginner_cat_feed_list() { 

$string .= '<ul>'; 

$string .= wp_list_categories( array(

        'orderby' => 'name',

        'show_count' => true,

        'feed_image' => '/path/to/feed-image.png'

        'echo' =>

    ) );    

$string .= '</ul>'; 

return $string; 

}

$add_shortcode('wpb-cat-feeds', 'wpbeginner_cat_feed_list' );

Now, You have to replace the ‘/path/to/feed-image.png’ with the feed icon image URL you copied in the earlier step.

Afterward, you can use the [wpb-cat-feeds] shortcode anywhere on your WordPress site to show the list of categories with the RSS feed icon beside each category.

3. Display RSS Feed Subscription Option on Category Pages 

Generally, the category archive pages in WordPress do not have a subscribe option. You can add a link to the RSS feed subscription on each category page.

For that, you have to make some changes to your template files in WordPress.

So, copy the code and paste it to the category.php or archive.php template in your WordPress theme.

 <?php       

if ( is_category() ) { 

$category = get_category( get_query_var('cat') );

if ( ! empty( $category ) )

echo '<div class="category-feed"><p><a href="' . get_category_feed_link( $category->cat_ID ) . '" title="Subscribe to this category" rel="nofollow">Subscribe</a></p></div>';

}

?>

Then save the changes you made, and you can see the subscribe link in action by visiting any category page.

How to Utilize Category RSS Feeds in WordPress

The Category RSS feeds to let your users subscribe only to areas of their interest.

For example, if you have a technology news blog, your users can choose to subscribe only to news about the devices they use.

But, a plain RSS feed is not readable without a feed reader, and these days, most users do not use a feed reader to subscribe to their favorite websites.

Here’s the tricky part. How will you use your category RSS feeds if your users don’t use the feed readers?

Fortunately, you can use your category feeds to provide content to users wherever they want.

For example, you can ask users to sign up for your email newsletter with an option to get updates only for specific subscribed categories.

You can use email marketing services such as Sendinblue, Constant Contact, and others to set up an automated RSS-to-email newsletter only for specific subscribed categories.

See our tutorial on how to notify subscribers of new posts stepwise.

Moreover, you can also let users get instant push notifications for each category. For that, you can use PushEngage, the best push notification service on the market.

It enables you to send messages directly to your user’s devices. Also, you can set up automatic push notifications using RSS feeds. 

We hope this write-up helped you make a separate RSS feed for each category in WordPress.

If you liked this, you might also want to see our tutorial on How to add custom post types to your WordPress RSS feed

Leave a Comment