exclude blog categories from RSS feed

#1095481
Viewing 1 replies (of 1 total)
  • Hello,

    We apologize for the issue you are facing. To exclude certain blog categories from your RSS feed in WordPress, you can use a custom function in your theme’s functions.php file. Here’s how you can do it:

    1. Access the functions.php File:

      • Log in to your WordPress dashboard.
      • Go to Appearance → Theme File Editor.
      • Select the functions.php file from the right-hand sidebar.
    2. Add the Following Code:

      function exclude_category_from_rss($query) {
         if ($query->is_feed) {
             $query->set('cat', '-ID'); // Replace ID with the category ID you want to exclude
         }
      }
      add_action('pre_get_posts', 'exclude_category_from_rss');
      • Replace ID with the actual ID of the category you want to exclude. You can find the category ID by hovering over the category name in the Categories section of your WordPress dashboard.
    3. Save Your Changes: Click the Update File button to save your changes.

    After implementing this code, the specified category will be excluded from your RSS feed.

    If you’re not comfortable adding code to your theme files, you might consider using a plugin that allows for more straightforward management of RSS feeds.

    For comprehensive assistance, we also offer a professional setup service to ensure your plugin is configured correctly. You can find more information about this service at Rank Math Professional Setup.

    Thank you for raising this concern! If you have any further questions or need additional help, please feel free to reply to this ticket, and a human agent will assist you further.

    Sources:
    How to Disable RSS Feeds in WordPress » Rank Math

    This is an automated reply from Rank Math Support Bot. If you need further assistance, please reply to this topic and a human support agent will reply to you shortly.

    Hello,

    Since we did not hear back from you for 15 days, we are assuming that you found the solution. We are closing this support ticket.

    If you still need assistance or any other help, please feel free to open a new support ticket, and we will be more than happy to assist.

    Thank you.

Viewing 1 replies (of 1 total)

The ticket ‘exclude blog categories from RSS feed’ is closed to new replies.