Menu

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



Do you want to make a separate RSS feed for each category in WordPress?
Categories allow you to easily sort your content into major sections. Adding category RSS feeds can help your users subscribe to specific areas of your website that interest them.
In this article, we will show you how to easily make a separate RSS feed for each category in WordPress. We’ll also talk about how you can use them effectively to grow your website.

Locating RSS Feed for Categories in WordPress
Categories and tags are two of the main default taxonomies in WordPress. They allow you to easily sort and organize your content into different subjects and topics.
By default, each category on your WordPress website has its own RSS feed. You can locate this RSS feed by simply adding ‘feed’ at the end of the category page URL.
For instance, if you had a category called ‘News’ with a URL like this:
https://example.com/category/news/
Then its RSS feed would be located at the following URL:
https://example.com/category/news/feed/
Tip: You can find your category URL by visiting Posts » Categories page and clicking on the View link below a category.

Display Your Category RSS Feed Links in WordPress
Now that you have located the RSS feed URLs for your categories, let’s take a look at some of the ways that you can share them with visitors on your WordPress website.
1. Add Links to Category RSS Feeds in WordPress
The easiest way to point users to a category RSS feed is by adding a link to the category feed.
You can simply edit a post or page and add a plain text link anywhere you want.

You can use this method to manually create a list of links to all your category RSS feeds.
However, what if you add, delete, or merge categories in the future, then you will have to manually update that list.
Wouldn’t it be nice if you can show a dynamic list of category RSS feeds that is automatically updated? Next we’ll show you how to do just that.
2. Manually Display a List of Category Feeds
This next method allows you to display a list of categories with links to the category-specific RSS feed. Best of all, the list will update automatically if you add or remove a category on your site.
For this method, you’ll need to add some custom code to your WordPress website. If you haven’t done this before, then take a look at our guide on how to easily add custom code snippets in WordPress.
First, you need to find an image that you want to use as the RSS feed icon. For this tutorial, we are using the RSS feed icon that is 32×32 pixels in dimensions.
After that, you need to upload that image to your website. Simply go to Media » Add New page to upload your image and then click on the ‘Copy URL to Clipboard’ button.

Now paste this image URL in a plain text editor like Notepad or TextEdit. You’ll need it in the next step.
After that, you need to paste the following code to your theme’s functions.php file or a site-specific plugin.

function wpbeginner_cat_feed_list() {
$string .= ‘

    ‘;
    $string .= wp_list_categories( array(
    ‘orderby’ => ‘name’,
    ‘show_count’ => true,
    ‘feed_image’ => ‘/path/to/feed-image.png’
    ‘echo’ =>
    ) );
    $string .= ‘

‘;
return $string;
}
$add_shortcode(‘wpb-cat-feeds’, ‘wpbeginner_cat_feed_list’ );

You will need to replace the ‘/path/to/feed-image.png’ with the URL of the feed icon image you copied earlier.
Now you can use the [wpb-cat-feeds] shortcode anywhere on your WordPress website to display the list of categories with the RSS feed icon next to each category.

3. Show RSS Feed Subscription Option on Category Pages (Advanced)
Normally, WordPress category archive pages don’t have an option to subscribe. You can easily change that by adding a link to the RSS feed subscription on each category page.
To do that, you’ll need to make changes to your WordPress template files. Simply add the following code to the category.php or archive.php template in your WordPress theme.