• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer

The Cre8tive Diva - WordPress Developer

Digital Nomad | Helping WordPress & Genesis Framework Website Owners All Over the World

  • Home
  • About
    • Terms of Service & Privacy
    • Accessibility
  • Services
    • Pre-Made Genesis Theme Installation & Customization
    • Same Day Installation Service
    • Blogger to WordPress Migration
    • Buddypress Installation
  • My Work
  • Blog
    • Tutorials
    • Five on Friday
    • Genesis Framework
    • Tipsy Tuesday
    • WordPress
  • Contact
    • Support
  • Shop
  • 0 items$0.00

Published on: October 6, 2017

How to Exclude (Hide) a Category from the WordPress RSS Feed

FacebookTweetPinPrintShare1

I received an email asking if a category could be excluded or hidden in her RSS Feed. She is using MailChimp’s RSS-to-Email and does not want a category for her personal blogs to show up in her newsletter.

The answer is Yes.

*Note: This should only be done with one category. If the blog is in more than one category, there is a chance the blog may still show up in the feed.

If you are unfamiliar with working with your theme files, stop and ask for help. If you are familiar with modifying your theme files – you should back them up before proceeding.

Find the Category ID

The first thing you need to do is locate the ID number of the category. You can do this by editing the category. Then look in the address bar for the ID number as shown below. Or you can install the Reveal IDs plugin to add the ID column to your pages, posts, categories and tags.

hide category rss feed

Adding the Code

  1. Using your FTP program or in your File Manager of your hosting account, browse over to your Child Theme Folder (i.e., Foodie Pro, Brunch Pro, etc.).
  2. Open the Functions.php file.
  3. Copy and paste the following code to the bottom (be sure to add a new line before pasting).
  4. On Line 4, change the number “7” to your category ID.
  5. Save it.
//Exclude Category from the RSS Feed
function c8d_exclude_category_rss_feed( $query ) {
if ( $query->is_feed ) {
$query->set( 'cat', '-7' ); // Change this number to the category ID you wish to exclude
}
}
add_action( 'pre_get_posts', 'c8d_exclude_category_rss_feed' );
view raw functions.php hosted with ❤ by GitHub

Then visit your RSS feed. If items from that category still show up, you may be using a caching plugin. As such, you will need to flush/clear the cache to get a clean view of your RSS Feed.

That’s it!

Did you find this blog or tutorial helpful?
Buy Me a Coffee at ko-fi.com
Like my Signature? Get the Signature Widget for Genesis right here!

Filed Under: Tutorials, WordPress

Primary Sidebar

Sign Me Up!

Receive my blog posts, tips and updates delivered to your inbox!

Yes, Sign Me Up

*By signing up you will receive new blogs, updates on products, services and important alerts.

Categories

  • Design
  • eCommerce
  • Five on Friday
  • Fonts
  • Free Themes
  • Freebie Friday
  • Genesis Framework
  • Genesis Plugins
  • Genesis Themes
  • Genesis Untapped
  • Instagram
  • MailChimp
  • News
  • Plugins
  • Press This News
  • Promotions
  • Social Media
  • Tipsy Tuesday
  • Troubleshooting
  • Tutorials
  • Uncategorized
  • Web Development
  • WooCommerce
  • WordPress
  • WordPress Plugins

Footer

Digital Nomad! I can be anywhere I wanna be now.

Follow Me

  • Facebook
  • Google+
  • RSS
  • Twitter

Latest Blog Posts

  • #BlackFriday Save up to 75% on New Hosting
  • Temporary Fix When Using Genesis Blocks Posts and Page Grid with Genesis Simple Share
  • How to Add Reading Time to a WordPress Genesis Child Theme Without a Plugin

Looking for Something?

Copyright © 2012–2021 · Designed with by Me! · Hosted on SiteGround