Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →To keep selected categories out of WordPress’s main RSS feed, exclude their category IDs from the feed query. The most controlled way is a small pre_get_posts callback that changes only the main feed query. You can still keep category-specific feeds available, but test those feed URLs separately after the change.
Choose the right way to exclude categories
WordPress supports category exclusions through query variables. The two practical routes are a code hook or a feed URL/plugin control. The best fit depends on whether you want a site-level change, how comfortable you are maintaining PHP, and whether child categories should also be excluded.
| Approach | Where it applies | What to maintain | Child-category behavior |
|---|---|---|---|
pre_get_posts with category__not_in |
Can be scoped to the main feed query; an overly broad callback can affect other queries. | Category IDs and the PHP callback. | The category__not_in exclusion does not include child categories, according to the WP_Query reference. |
Negative IDs in the cat query parameter |
Feed URL or plugin controls, depending on how the URL is used. | Category IDs in the URL or plugin settings. | The reference documents this exclusion form, but does not establish that it has identical edge-case behavior to category__not_in. |
| RSS Control plugin | The plugin listing describes feed URL controls and category-exclusion examples. | Plugin settings and compatibility with your current WordPress setup. | Check the plugin’s current behavior and compatibility; the listing does not establish every theme or plugin interaction. |
Exclude categories from the main feed with PHP
The pre_get_posts hook runs before a query executes and lets you change its query variables. The important safeguard is to check that the request is not in the admin area, that the query is the main query, and that it is a feed before setting exclusions. See the WordPress developer reference for pre_get_posts.
- Find the numeric IDs of the categories you want to omit. You can inspect a category’s edit link in WordPress to locate its ID.
- Add the callback below to a site-specific plugin or your theme’s
functions.php. A site-specific plugin is easier to keep active if you later change themes. - Replace
12and34with the category IDs to exclude. - Save the change and test the main feed and any category feeds you intend to preserve.
add_action( 'pre_get_posts', 'my_exclude_categories_from_feed' );
function my_exclude_categories_from_feed( $query ) {
if ( is_admin() || ! $query->is_main_query() || ! $query->is_feed() ) {
return;
}
$query->set( 'category__not_in', array( 12, 34 ) );
}
This example is deliberately limited to the main feed query. Do not remove those checks casually: changing query variables without appropriate conditions can alter other front-end queries, such as archive or secondary queries. The hook reference demonstrates checking query context before modifying the main query.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
#1 Best Overall
- Used Book in Good Condition
Understand category IDs and child categories
category__not_in expects an array of category IDs, not category names or slugs. Its documented exclusion does not include child categories. If you also need posts assigned to subcategories excluded, account for those IDs explicitly and test the result; do not assume the parent ID automatically removes its descendants.
The cat query variable also supports negative category IDs for exclusions, including multiple exclusions. It is an alternative documented form, but its behavior should not be treated as identical to category__not_in in every edge case. The WP_Query reference documents both forms.
Rank #2
Use a feed URL or plugin instead of editing PHP
The WordPress.org listing for RSS Control describes controls for feed URLs and examples using category-exclusion query parameters. This is an optional route, not a requirement. Before relying on a plugin, check its current compatibility and confirm how its settings affect the particular feed URLs you use.
A URL-based exclusion can be convenient when you control the feed URL, but it may not provide the same site-wide behavior as changing the main feed query. Confirm the resulting URL and contents with your feed reader or another feed validator rather than assuming the parameter is being applied.
Recommended Free Tools
Keep category-specific feeds working
WordPress provides category feed links. The core link-template.php implementation shows how category feed links are generated. If readers or integrations use a category feed, test its URL after changing the main feed. Verify that the main feed omits the selected posts while the category-specific feed still returns the intended posts.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Do not confuse hiding a label with excluding a post
The the_category_rss hook filters category labels rendered in feed markup. It can change which category names appear alongside an entry, but it does not remove posts assigned to those categories from the feed. To omit posts, change the query; to alter labels only, use the markup filter. The distinction is reflected in the WP_Query reference and WordPress’s feed link-template code.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




