I think you can go even simpler in the coding. Just add the below to your functions.php file within your theme folder.
function myFeedExcluder($query) {
if ($query->is_feed) {
$query->set('cat','-73,-9'); // categories 73 and 9 are being excluded
}
return $query;
}
add_filter('pre_get_posts','myFeedExcluder');
Note particularly that multiple categories can be excluded by separating them with commas.
And here’s the codex page on customizing feeds, but it doesn’t specifically address this situation.
Related Posts:
- Individual rss feed entry length for categories?
- How to make category RSS feeds show full content
- How to not treat categories as tags in feeds
- Displaying multiple loops based off of category
- Creating a custom feed for categories that includes the first post’s featured image
- How to put page numbers with the next/previous on a post/category list?
- Properly setting up a feed
- How replace individual elements in the RSS feed with a single string
- How to fetch common posts from two feeds?
- Change rss title of individual feeds?
- Reversing the order of items in a category rss feed?
- Replace category titles inside RSS feed
- Is There a Difference Between Taxonomies and Categories?
- WooCommerce: List All Categories
- How can I hide a category from Contributors in the edit/add new post screen?
- Category page doesn’t use category.php, instead it redirects to homepage
- Multiple post categories – single permalink
- Wrap Post count in a span
- wp_nav_menu not appearing for a couple pages
- Create product category and keyword search form in woocommerce? [closed]
- Display one category in one page
- Exclude most recent posts from specific category in wp_query()
- Display all posts with same title
- Show children of top level category only
- is_archive() content being shown instead of is_category()
- wp_list_categories to show list of categories and the description
- How to display a description of a given category from a custom taxonomy
- Add custom taxonomy under the category title
- Retrieve all posts within tag OR category?
- How to modify category.php to list posts alphabetically?
- Include template before a loop
- How to customize tag and category post listings to show introductory content?
- Include posts from feature category in pre_get_posts
- Create blog page only to see one category
- Looking for the best solution to build this Blog structure? Picture attached?
- How Can I Display Categories Description
- Specified number of categoy posts not showing correctly
- Display Slug instead of Name
- Set Current Category to Active in category.php
- Filtering multiple categories via the URL
- WordPress query via checkbox form
- Multiple categories with common subcategories
- Counter in loop in foreach
- How to limit number of attachments
- Show category name and new articles and display page numbers. What function to use
- Add child category to parent on post creation and save
- wp_list_categories in in nav_menu
- Sub category templates
- How to use an array of categories as a dropdown?
- ACF add custom fields to categories and display
- How to add custom color fields to the category edit page?
- How to create a custom categories page
- Target a specific category from a custom taxonomy?
- How to modify the output of wp_terms_checklist when used within the built-in category metabox on edit posts?
- Searching for a category returns nothing if category is empty
- Category page returns 404 error
- How to get nav to show current_page_parent class when on regular post (not blog), differentiated by category
- How to exclude posts from category posts count
- Random category with recent post title and thumbnail
- Pretty URLs with Categories and Tags
- Select posts that match multiple category names, must match all categories listed
- How can i display category title over thumbnail?
- How to display the 5 latest post titles but allow only 1 in there of a specific category
- How to add categories using mysql
- Posts made to category don’t show up (do show up on frontpage)
- How to use category slug with a regular page
- Display all categories but only if they have posts in them that have a specific tag assigned
- How to fix select filter on category
- wp_dropdown_categories() works correctly but the list is not filtered in admin for custom post type. What is the problem?
- Show audio player only in specific post type category
- Check with Jquery if second level checkbox from categories are checked
- display current portfolio categories from a specific parent
- Regarding Tags And Categories
- How to show entries related to main category
- selecting categories that have products with tag/category
- How to get WooCommerce Product Categories and its children’s children?
- Media Library Category Exclude Tree
- When category name and title are the same … WP will select archive.php instead of single.php
- Re-coding category-template.php to go to custom URL
- Category removal – Portfolio Category:
- How to display child-category PAGES on a category page
- How get all media from a posts category by db?
- Cant get unique_array() work on get_the_category() foreach loop
- Show One Level Category id
- get_categories returns top-level categories instead of child categories
- Show posts from all categories
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- how to Specifies an author / editor to edit one category only?
- Show one same template for two category
- My Query is getting the wrong data
- Formating content in category.php
- How to use Greek characters/letters in a query?
- Getting categories to change appropriately when using $cat = ‘ ‘;
- Display post content from category name using ajax
- How to display the category featured images [closed]
- Echo Category In Loop
- How to get specific number of category post on a page or category page?
- Use same wordpress category base and tags as the prefix as the post permalink
- Display different sidebar based on search results from one category
- Adding category to existing post (uploaded file)