Monday, November 30, 2020
Home Blogging How to Exclude Specific Categories from WordPress RSS Feed

How to Exclude Specific Categories from WordPress RSS Feed

Do you need to exclude particular categories from RSS feed in your WordPress web site? Many web site homeowners use some categories for content material that they don’t need to seem within the RSS feed of their web site. On this article, we’ll present you the way to exclude particular categories from WordPress RSS feed.

Technique 1: Exclude Particular Categories from WordPress RSS Feed Utilizing Plugin

Very first thing you might want to do is set up and activate the Final Class Excluder plugin. For extra particulars, see our step-by-step information on the way to set up a WordPress plugin.

Upon activation you might want to go to Settings » Class Exclusion to configure plugin settings.

The settings web page will show all categories in your WordPress weblog with choices to cover them from entrance web page, RSS feeds, archive pages, and search outcomes.

Merely choose the exclude from feed field subsequent to the categories that you simply need to exclude out of your RSS feed.

Don’t neglect to click on on replace button to avoid wasting your settings.

That’s all, posts filed below your chosen categories will disappear out of your WordPress RSS feed.

Technique 2: Manually Exclude Particular Categories from WordPress RSS Feed

This technique requires you to stick code in your WordPress information. You should utilize this technique in case you are snug with pasting code snippets from internet into WordPress.

It’s good to add this code to your theme’s features.php file or a site-specific plugin.

1
2
3
4
5
6
7
function exclude_category($query) {
    if ( $query->is_feed ) {
        $query->set('cat', '-5, -2, -3');
    }
return $query;
}
add_filter('pre_get_posts', 'exclude_category');

This code merely excludes categories that match the given IDs. Merely substitute the class IDs within the code with the IDs of categories that you simply need to exclude.

See our information on the way to discover class IDs in WordPress.

For those who simply need to exclude a single class, then change the code like this:

1
2
3
4
5
6
7
function exclude_category($query) {
    if ( $query->is_feed ) {
        $query->set('cat', '-15');
    }
return $query;
}
add_filter('pre_get_posts', 'exclude_category');

Substitute -15 with the ID of class that you simply need to exclude from RSS feed.

You May Also Like : How to Add an Admin User in WordPress using FTP

We hope this text helped you discover ways to exclude particular categories from WordPress RSS feed. You might also need to see our listing of 10 most needed class hacks and plugins for WordPress.

If you liked this article, make sure to hit the bell for getting our latest updates and share this article with your friends in every social media platforms.

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

How to Signup for Godaddy Affiliate Program & Start Making Money

GoDaddy is likely one of the well-liked model names out there of area and web-hosting. They are well-liked for a numerous cause, and so they...

How To Start Selling Website on Flippa: A Beginner’s Guide To Success

If you may have been working on-line for lengthy and into Website flipping, Flippa is one identify that you need to have heard of. Flippa is a...

How to Fix Your Connection is Not Private Error (Site Owners Guide)

Are you seeing ‘Your connection is not private’ error in your WordPress web site? This is the error message you’ll see on Google Chrome. The...

How to Fix the WordPress White Page of Death (Step by Step)

The WordPress white page of dying is one of the most widespread WordPress errors. It can also be one of the most irritating ones as...

Recent Comments