Ultimate Category Excluder for WordPress

Ultimate Category Excluder Plugin

Ultimate Category Excluder (UCE) is a WordPress plugin that allows you to quickly and easily exclude categories from your front page, archives, feeds, and searches. Just select which categories you want to be excluded and UCE does all the work for you!

You can download this plugin from the WordPress plugin repository.

This plugin has been particularly handy with categories that house useful content, but content that I don't want to have appear on the homepage or in my feeds. For example, I have a number of definitions for technical terms and while these can help users reading my content, there's no need to have a definition appear on my homepage or get pushed out via my RSS feeds.

Ultimate Category Excluder Plugin Screenshot

If you have a feature request or have found a bug, please report it below.

1 Star2 Stars3 Stars4 Stars5 Stars (4 votes, average: 4.75 out of 5)
Loading...

86 Comments

  1. Thank you, thank you and thank you. Is Perfect !!!!!

  2. Not work with Woocommerce category… :-(

  3. Hi,

    Plugin not excluding post category from my front page. Please can you help.

    UCE version: 1.1
    PHP version: 5.3.28
    WordPress version: 4.9
    Theme: Portfolio Press is version 2.7.2
    Number of categories is: 17

    • There are no hidden settings or "tricks" to using the plugin. If it doesn't work as hoped, your theme or another plugin is doing something other than what my plugin is "expecting". Probably best to just try another plugin.

  4. hello. Very nice plugin, thank you. What iam curious about is- if i hide a category - is it hidden from search engines as well? I would like to have some pages that are not visible in my site navigation - but should be accessible through google search. can i do this? thank you.

    • Users and search engines will see the same thing.

  5. Hello,
    I think all of your plugins are great. I use a number of them on my website www.attractionsnearme.co.uk I recently purchased the pro version of Republish old posts because it is so helpful. In regards to Ultimate Category Excluder, my PHP error log occasionally informs me of a timeout error. I don't know if I have a compatibility issue but UCE is often listed. PHP Fatal error: Maximum execution time of 30 seconds exceeded in /home/jacko999/public_html/attractionsnearme.co.uk/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 133
    This appears to occur when I am writing large posts on my network at home. Any advice or guidance would be much appreciated.
    Regards Dan

    • Hmmm... that's a new one for me. Have you ever looked into increasing the max execution time for your site?

  6. Hi Marios,

    I experience a problem with a multi language installation. Your plugin works fine for one language but if I change the settings for the second language it overwrites the settings of the first language. Therefore, I can only configure one language.

    Works:
    http://markuskramer.net/latest-thinking/

    Doesn't work:
    http://markuskramer.net/de/latest-thinking/

    I use WPML as a translation plugin. Is there some kind of workaround?

    Thanks

    • Not that I know of. I haven't done much with WPML.

  7. Not all my categories are showing as an option to exclude, especially the one I want to exclude in the first place.

    • I haven't heard about that sort of issue before. Is there anything special about the missing categories? Do they show up in the list of categories on the category page: wp-admin/edit-tags.php?taxonomy=category ?

      Do the missing categories include any special characters?

      • Nothing special about the categories. They are listed here: http://www.transducersdirect.com/wp-admin/edit-tags.php?taxonomy=product_cat&post_type=product. I am also using Woocommerce.

        I am not using any special characters. The list is missing many categories.

        • Sorry, but I'm at a loss as to why you're encountering this issue. If you see any errors on the screen or in your error logs, let me know as they may direct me to the problem.

  8. Unfortunately it does'nt hide sub-categories :-/
    I have a category A with sub-categories a,b and c.
    I wanted to hide all posts of category A from start-page.
    The posts directly in category A were hidden, but i expected, that the posts in the sub-categories also be hidden. But it's not.

    • Did you select the sub-categories to be excluded or did you just select the parent category to be excluded?

      • I only selected the parent-category and expected, that all sub-categories automaticlly also be hidden.
        For me that would be logically and it's the idea of an hierarchie of categories and sub-categories.

        • Yes what you describe is a valid expectation, but so is expecting to have full control over sub-categories which some people do want. Sorry the plugin doesn't behave as you want.

      • Marios, i'm happy that such plugins exist, so there is no reason to say "sorry". :)
        I just would understand how this plugin works, and suggest to add a checkbox "exclude sub-categories" to this plugin.
        Anyway it will be very useful to me, so, thanks for your work!

  9. I'm using this plugin with Divi theme (Elegantthemes). I have a post slider on the homepage that has two posts. I don't want these posts to show in the blog archive but when I exclude them using Category Excluder, then they don't show up in the post slider either. Is there a workaround for this?

    Thanks.

    • Sorry, but there are no hidden settings or anything.

      • So no solution?

        • Correct. There's no existing solution for the case you've described.

  10. This is a really nice plugin and does what I wanted to with a very simple interface that is quite easy to use. The only problem I'm having is for some reason when I activate and use this plugin it makes a static menu show up on my mobile site. Only the mobile site though. Any ideas?

    • That's strange. I don't know why a menu would appear on mobile unless the theme was set up to do just that.

  11. Hi Marios. Thanks for developing this plug-in. (btw I was also expecting Bolek's use case above to be supported.)

    Right now I'm struggling to prevent my posts being excluded from the category feeds. I've excluded categories from the homepage, archives and search but they are now also missing from http://[domain]/category/[categoryName]/feed/

    Any thoughts?

    • The plugin works by intercepting requests for posts and then modifying those requests. The challenge is that "who" is making the requests isn't always identified so I don't have a way to determine when and when not to modify the post list. From what you're describing the request to generate a category feed is being interpreted as another type of request which is resulting in the exclusion. There are no tricks or secret settings that you're missing.

      • Thanks for your reply Marios.

        Exclude from Feeds doesn't seem to do anything - the posts are still in the feeds with the following URL format:

        http://[domain]/category/[categoryName]/feed/

        What I want to do is have posts in two categories excluded from everything but the RSS feed, unless they are in other categories as well.

        If I could get all categories but those two excluded from a general RSS feed then I could make that work... please could you explain how the 'Exclude from feeds' works? Which feeds?

        • Excluding from the feed keeps things out of the main feed.

      • Hi Marios,

        Just downloaded it to my website and I have no "options" to chose the categories to exclude?

        Do you have a user guide?!

        • Check out Settings -> Category Excluder

  12. Hello - I've just started using your plugin and it works to hide the categories selected. However, for some reason, it is also hiding the Author Box at the bottom of the posts, as well as the Comment box. Therefore, a reader will not be able to leave a comment on the posts in the hidden category.

    Is there a way to get the Author Box and Comment Box back for these posts?

    I look forward to hearing back from you - thank you for your time!

    • That's unexpected behavior that I haven't heard about before. My guess is there's some incompatibility with your theme.

      • Any ideas for a work-around?

        We are using the Olsen Pro theme from cssignitor .
        Have you heard of any incompatibility with any other plugins?

        This is the only plugin I have found that hides the categories from the front page and feed, but it's pretty important to be able to have the comments available.

        In case this helps, in the hidden category posts, I can click on the 0 Comments link at the top of the post and this brings up the Comment box. I can then leave a comment and post it, but of course it does not show up - since the Comment box doesn't appear.

        I realize this is a free plugin and that your time is limited - I appreciate that. But if you have any suggestions on how to fix this issue, I would be grateful. Thank you.

        • No I haven't heard about incompatibilities. Some folks have tried to hide things from the homepage post listing while not hiding things from widgets on the homepage, but I don't have a solution for that particular issue yet.

      • Hi there

        i installed and activate the plugin but i can't find in it in the menus of WP.
        Could you please let me know how can i find it to edit the option.
        My wordpress version 4.6

        Kind Regards
        Moe

        • Go to Settings --> Category Exclusion.

  13. Thanks for the plugin.

    I have excluded the category I want from my main page, but I would like the posts in this category to nonetheless appear in My Recent Posts widget. How can I do this?

    Thanks,
    Steven

    • I've been working on this very feature, but so far I've failed to find a way to do it. I may come up with a solution still, but there's no way for me to know the timing.

  14. I am using SQLite Integration plugin.
    Everything works fine, but the console logs:

    Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, object given in /Users/andy/Sites/smmio/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 93

    I just removed the line and then everything is fine...

    a.

    • That's known issue (it's a warning, not an error), but the function is only used on the admin screen to provide some diagnostic information that appears under the Support heading. The warning doesn't affect the behavior of the plugin.

  15. Thanks a lot for this excellent plugin doing what's expected ...
    I have one question related to the post count in archives...

    I currently have 18 posts in all categories
    I excluded 2 categories from the archive page ( 8 posts)

    In my footer Archive widget, the displayed total posts in June 2016 is 18 which reflects the overall count... should not it be 10 ( overall - excluded ) ???

    Is there a way to patch it ?

    • Chances are that the widget is doing its own count outside of any other logic on the page. As such it's bypassing the plugin and so the count is off. I don't know of a universal way to intercept requests from the many different widgets out there that might be counting posts.

  16. Hello I need your help...I have created a movie site where I embed code from some file sharing sites. I am doing them manually. I have about 60+ movies added. I also want some post from certain categories to be excluded and your plugin works great! My only problem is the page navigation at the button is gone.. I tried to change in to true but it only have added 1 page navi.

    Please take a look at my website...
    Http://moviestmr.com

    PS. When I tried to uninstall UCE the page navigations are back to normal...Do you have some solutions for this?

    Regards
    Michael

    • That sounds like some incompatibility. But I'm not familiar with your theme or other plugins to be able to say what the problem might be. If you see an error message anywhere, let me know as that would be something I could act on.

      • Actually there is no error. Its just the navigation for pages are gone at the bottom of the posts. Before i activated the UCE it shows 4 pages, 1,2,3, &4 but now even if I change the (false) code into (true) it will only give my page 1 which is also linked to the homepage...I would love to give you an access to my editor page if you need to..tnx

        • Sorry for the trouble you're having with the plugin. Unfortunately, this is a free plugin so I can't dedicate the time to go into individual installations to try and identify conflicts or other problems. If there was an error generated by my plugin, I would investigate as it would clearly indicate a problem with the plugin. Without an error I could spend hours looking into what the issue is...

  17. Hello, I have an issue... I have about 30 categories on my site, I've exclued all of them from the homepage - all but one (it's a "news" category). But sometimes, my client wants to have post from a different category to be shown on the homepage. I've tried to put one post into two categories - logical, isn't it? But it doesn't work with your plugin :( If a post is in the "news " category - it shows on the home page. If its in the "news" and "other" category - it doesn't show on the homepage. Can you help somehow?

    • The plugin is designed to look for a matching category and exclude if the match is found. There aren't any settings that allow you to override this or to tell the plugin that there are exceptions. Do you use tags? If not, maybe you could use tags to control what shows on the front page?

      • I don't get it... I have category A and category B, category B is excluded from the home page. And a certain post is added both to A and B category; this post should be visible on the home page, hence the A category is visible...

        • The plugin asks the question "should this post be excluded?" Not, "should this post be included?". It's a slight difference, but it means that as posts are being examined, the question returns with an answer of "yes this post should be excluded" because it is part of category B. And once it's been excluded, there isn't anything that counters that directive even though it's assigned to another category that hasn't been excluded.

  18. Hi,
    I have a category of pages in my site. And I am trying to hide the sub-categories on my front-page using Ultimate Excluder but unfortunately its not working. Any idea how can I resolve this issue. Thanks.

    • Sorry, but from your description I can't tell why it might not be working for you. Do you have debugging turned on? Are you seeing any errors? Are the posts in the sub-category you're excluding assigned to other categories as well? I just excluded a sub-category from my front page to make sure nothing was broken in the current release.

      • I dont see any errors. Basically I have Categories A,B & C having sub-categories a,b & c respectively. I am using HTML5blank theme, where I am linking these categories to Menus AMenu, BMenu & CMenu. So on my front page, along with these three menus, I also see a,b,c under the main menus.

        • And you've blocked a, b, c from the front page, but you still see posts appearing from them? And these posts are assigned to just the a, b, and c categories?

        • Thats right!!

        • OK. That configuration should work. It's what I tested on my test site and the posts from the sub-categories didn't appear in the front-page listing. So it's strange that your posts still show up. The only thing I can think of is to turn on debugging and see if there are errors reported. Perhaps there's a conflict with another plugin.

  19. Hi Marios,

    Thank you for this very useful plugin.

    However, I have a little issue with it. I created an article category, that I would like to be "hidden" on my website, but visible in the category feed (www.mysite.com/category/mycategory/feed). So, i choosed these checkboxes in your plugin : "Exclude from Main Page", "Exclude from Archives" and "Exclude from Search".

    When I go to my principal RSS feed (www.mysite.com/feed), I see my articles. But when I go to that particular category feed (www.mysite.com/category/mycategory/feed), there's nothing...

    Thank you in advance for your help !

    • Hi Marios,

      Could you please help me ?

      • Sorry, but I'm not sure what I can do. The plugin just may not work for your particular setup.

  20. There is an issue with the plugin in that tools that use the xmlrpc interface end up having posts excluded when categories are excluded from the home page. I was able to fix it by adding another clause to your test for the home page:

    if ( $query->is_home && $query->is_main_query() ) {

    Posts still don't show up on the home page, but do show up in Live Writer and Marsedit

    • Thanks for sharing. Looks like I need add an option to allow for people to handle this case.

    • Hi Derek - I'm the developer of MarsEdit and was just looking into finding a workaround for this, so thanks for doing the legwork and sharing it here!

      Marios - great plugin, I'm using it myself but of course I wanted to be able to continue editing category-excluded posts from my own blog editing app.

    • I feel I must point out one shortcoming however with Derek's proposed solution: the excluded posts are then made visible in non-main, but nonetheless visible content such as the "Recent Posts" widget of a blog. It seems like another solution must be found to ensure that the filtering doesn't happen when XMLRPC calls are being made. Maybe a higher priority filter on some XMLRPC hook that will flag disabling the filtering?

    • Sorry for the multiple comments, but I think I have a reasonable solution: add_action on xmlrpc_call will allow the plugin to detect whether the plugin has been activated in the context of an XMLRPC request, and deactivate all its functionality in that scenario. This seems like the safest way to both ensure the plugin has no negative impact on XMLRPC, and to ensure that posts are only excluded when XMLRPC is being used to access the blog. Here's a working example:

      $ksuce_is_xmlrpc = false;
      add_action( 'xmlrpc_call', 'ksuce_ignore_xmlrpc_calls', 1);
      function ksuce_ignore_xmlrpc_calls() {
      global $ksuce_is_xmlrpc;
      $ksuce_is_xmlrpc = true;
      }

      function ksuce_exclude_categories( $query ) {
      global $ksuce_is_xmlrpc;
      print "Got ksuce is xmlrpc $ksuce_is_xmlrpc";
      if ($ksuce_is_xmlrpc == true) {
      return $query;
      }

  21. Hi,

    I've searched everywhere for a plugin like yours. I'm having a little issue, though. I want certain posts to be excluded from the category archives and it's achieving that, but it is also removing them from the front page. I"m also getting this message at the bottom of the plugin screen:
    Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, resource given in /nfs/c11/h05/mnt/204622/domains/booksumustread.com/html/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 93

    Is this error the cause of the plugin not working properly?

    Thanks

    • I don't get that error and I have debugging turned on. Could you tell me what version of PHP your server is running?

      • my host has me at 5.3.29

        • OK. So PHP isn't the problem. Can you send me the info that appears at the bottom of the plugin's admin screen?

          Also, is the post that's being excluded assigned to more than one category? And if it is, is one of the categories excluded from the home page?

        • I'm not sure if that last message went through so I'm going to duplicate it because my laptop is a little wonky today. I have child categories set up like this:

          Mystery
          -cozy mystery
          --featured cozy mystery
          --free cozy mystery

          My theme has modules where the category "cozy mystery" is listed on an archive page. If I keep the heirarchy like it is, the --featured cozy mystery and --free cozy mystery show on the cozy mystery archive page. The module is set up to do this. When I use your plug in, the featured cozy mystery category, which is shown on the front page, disappears from the archived page, but also from the front page.

          Here is what the admin screen says:
          Support

          Please report this information when requesting support.

          UCE version: 1.0
          PHP version: 5.3.29

          Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, resource given in /nfs/c11/h05/mnt/204622/domains/booksumustread.com/html/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 93
          MySQL version:
          WordPress version: 4.4.2
          Theme: Voice is version 1.3.1
          Number of categories is: 148

        • I looked into the error. It's not likely to be the cause of any problems. The error is generated when a request is made to get the version of the database. Perhaps your version is older and incompatible with the way I'm getting the version number, but even so the code continues to execute and so there's no impact.

          As for your issue, I'm trying to reproduce your settings. I've created the category hierarchy you've described, but I can't figure out from your description which categories you've excluded and from where. Can you indicate what's checked for each of these:

          Mystery
          -cozy mystery
          --featured cozy mystery
          --free cozy mystery

        • okay, so here is the hierarchy:

          Mystery - is the parent category
          Cozy mystery is a child of Mystery
          Featured and Free Cozy Mystery are children of Cozy Mystery

          The categories I'm trying to exclude are Featured and Free, as they are on the main page of my site and I don't want them included in the Cozy Mystery category page page as well. So when I check Featured Cozy Mystery and Free Cozy Mystery under the heading "Exclude from archive", they do, indeed, disappear from the Cozy Mystery category page, but they also disappear from their place on the front page as well. I thought that this was because of the date of the posts on the front page -- they are a few days old as I'm trying to work out a newsletter issue, but I updated one of the Featured Cozy Mystery posts with today's date and it made no difference.

        • I've created the hierarchy you've described.

          I've also set Featured Cozy Mystery and Free Cozy Mystery to be excluded from archives. Otherwise everything else in the UCE plugin is UNCHECKED. Does that match your setup?

          Also, for the posts in each category, do you assign them to the child category only or do you assign them to the parent and child? For example, is a Free Cozy Mystery post categorized as Free Cozy Mystery only or Mystery, Cozy Mystery AND Free Cozy Mystery?

        • As an example I only gave you Cozy Mystery. In reality, I have 8 main genres (Mystery, Thriller, Romance, etc.) 63 sub-genres and from these sub-genres each one has Featured, Free, and Topslider as a child category.

          So on the UCE all of the 63 sub-genre child categories (Featured, Free, Topslider) are checked and the rest is unchecked.

          Each post only has one category, so if I have a psychological thriller that is a featured book on the front page, the category will be Featured Psychological Thriller. If I add an additional category to it, the post will also appear in that category and I don't want that to happen. As it is, the child categories are being show on the sub-category page, which is what I'm trying to hide.

          I know this seems elaborate, but I'm trying to figure out how to link the sub-categories with their connected child categories so the child categories will be included in the subscribers email if they only chose the sub-category.

        • Ah so your setup is a little more complicated than the sample I put in my test environment. I'm not sure where to go from here as I can't reproduce your problem with just the simple setup I've put in place i.e. things are working as I'd expect. I'm also not seeing any errors generated so if I had to guess I'd say we're dealing with 1) a plugin/theme conflict OR 2) the features of my plugin aren't quite matching your expectations.

          On a sort of related note, I'm wondering if you might have an easier time achieving your goals if you combined categories with tags. Categories would cover the genres and sub-genres and tags would cover attributes like featured, free, and topslider. I'm not saying such an approach would work out of the box, but it's an idea that occurred to me so I thought I'd share.

        • Thank you for your time. I will look into using tags. I'm a little new at this so it's taking me a little longer to learn. I appreciate your help

        • WordPress is better than any other system at getting you a site that does 95% of what you want, but that last 5% can be tricky even for experienced folks. Good luck!

      • I'm getting the same error. But I have a much simpler structure than Theresa. I only have 5 categories. No matter which category I select, it is not excluded. Even if I select all categories in all fields, nothing gets excluded - and I only wanted to exclude categories from my main page.

        So far this plugin seems not to be working at all for me. Here is my information (I deleted the domain info):

        UCE version: 1.0
        PHP version: 5.4.45

        Warning: mysqli_get_server_info() expects parameter 1 to be mysqli, resource given in ***/public_html/wp-content/plugins/ultimate-category-excluder/ultimate-category-excluder.php on line 93

        MySQL version:

        WordPress version: 4.4.2

        Theme: Canvas Child is version 1.0.0

        Number of categories is: 5

        • I think the "warning" is a red herring. The particularly piece of code is just used to get the info about the environment and it isn't used to handle any of the exclusions.

          Still, there's obviously something wrong since the plugin isn't working for you. I'm guessing there's a plugin conflict. Could you post a list of the plugins you have activated?

        • Here are the plugins I have activated:

          * BackWPup Version 3.2.0
          Duplicate Post Version 2.6
          Google XML SitemapsVersion 4.0.8
          * Jetpack by WordPress.com Version 3.7
          MF Gig Calendar Version 1.0.3
          Ultimate Category Excluder Version 1.0
          Wordfence Security Version 6.1.3
          * WP Gallery Custom Links Version 1.10.3
          * WP Subtitle Version 2.5

          I need to update the plugins that have an '*', but I'm waiting to solve this current problem with your plugin first.

        • Hello Marious,

          I still can't get your Ultimate Category Excluder plugin to work. I deactivated all of the plugins that I listed one by one (except for MF Gig Calendar, I was afraid of losing my calendar data, which took a long time to input). I then updated the excluded category after each plugin deactivation, and then checked my main page, but I'm still not able to get the Ultimate Category Excluder plugin to work for me. I just need posts excluded from being listed on my main page.

        • Hi Steve. Sorry, but there's not much I can do from my side without some sort of error message to guide me. When I'm working on my own sites and I have unexplained issues, I need to turn on WordPress' debugging and go from there.

  22. Hi
    This does what I want. Great stuff.
    One issue. The posts are removed from the feed based on the category, but the category still remains in the filter list?
    Can this be also hidden in the blog feed?

    Thanks

    • What do you mean by filter list?

      • I have a theme that allows the categories to be set as a filter to show certain posts. Like "Art" would only show art articles with the art category.

        • Ah. That sounds like a theme-specific feature. I don't know how the list is being assembled so I'm not sure what, if any, fix there would be to the plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail.