Excluding Categories

This topic contains 10 replies, has 2 voices, and was last updated by

6 years, 1 month ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
  • #6863



    I have trouble excluding categories.

    I’ve dragged the ones I want excluded in the Frontend Settings > Categories

    However when the search results hover, they include the posts in the categories that I excluded. When I click on “more results” – then they ARE excluded.

    Please advise what setting I may be missing.




    The Frontend Settings > Categories only affects the visibility of the category selectors on the fornt-end settings drop down.

    To exclude the results from specific categories completely, go to the Advanced Options panel, there is a similar drag-drop item to exclude categories 🙂

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)



    Hi Ernest

    Thanks for the response!

    I have excluded there as well.

    However I realized what the problem is.
    When it hovers, it finds COMMENTS made in those excluded categories.
    I do need comments to be searchable in general – it’s quite important. But the comments in hidden categories need to be excluded.

    Any way to fix this?




    Ok so heres the problem:

    username Team3
    pass: test

    search form is here http://www.anticanceralliance.com/category/hypotheses/

    category called mapnd private is a category that I excluded in frontend and advanced setting

    try searching for “mapnd” – you get “good discussion on dose…” in the hover results – thats a comment from an excluded category. now when you click on “more results” – you do not see it.

    Now I have a comment in a visible category, I called it “testcommentsearch” – it comes up when the results hover but not when I click on “more results”

    Im not sure whats happening here – are comment searches somehow not visible in the results page or is it just that it excludes whatever showed up when results hover?

    Plus the original question – how to prevent it from showing comments from excluded categories




    sorry password above is “team” not test



    The problem with comments is that they are not custom post types (like posts, pages, products and so on) therefore they are a bit more problematic.

    Unfortunately it is not possible to show them by clicking on the “More results” link. That url redirects to the theme default search page, which can only display posts, pages or custom post types – but not comments, users, terms. It’s not the plugins fault, nor the themes fault, it’s simply how WordPress is constructed at the moment. I’m not aware of any method to make this possible at the right now.

    As for the categories, that might be possible actually. Currently it’s not implemented as it was never requested, and to be honest I never thought of it. But I think I might be able to do something about it.
    Let me make try to implement this on my test environment, and I will let you know which file to replace to make it work.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)



    Hi Ernest,

    My default search actually does display comments as I have a plugin called search everything.

    I believe there is an option in Ajax to override or not the default search, right?
    So if I don’t override it – comments do come up. If I do, then I think the category selection for the posts is lost.

    When you say categories – I’m assuming you mean excluding comments coming up from categories that have been excluded? That would be wonderful & very critical for me. The excluded categories are private and hold intellectual property – so comments cant be visible.

    Thank you!


    Hi Kristina!

    Wow, I didn’t know it was possible yet. I know that plugin, but I didn’t know it had that feature, amazing. Thank you for telling me. I guess I was wrong 🙂

    In that case if I may suggest turning off the override on ajax search pro. If it’s turned off I believe the search everything override will activate and display the comments on the search results page.
    I will examine Search Everything, hopefully I can learn how to mix comments into the results list and implement a solution to the ajax search pro as well. I’m afraid I can’t give you a quick fix to that soon, it’s definitely much more complicated as category exclusions.

    Yes, exactly that – excluding comments from categories that have been excluded.

    Today I have a bit of a peak of support requests, so you might have to wait until sometime tomorrow until I can fix this issue, I hope it’s not a problem.

    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)



    Tomorrow is perfectly good, thank you Ernest!

    I will play around with the settings for now.




    Just to add – turning override off does not actually work because as I thought – it erased whatever category selection that was made in ajax. Which sort of defies the purpose 🙂

    What I think I will do I think is have 2 separate search boxes – one for comments alone (with category selection)- displaying results with pagination instead of “view more” and the 2nd a regular search for categories etc – excluding comments completely. In a twisted way it may actually make sense for the users 😉

    However if you came up with a way to get ajax to display comments in results – it would certainly be welcomed news. I believe something called relevanssi (sp?) also searches for comments.

    Best Regards,

    • This reply was modified 6 years, 1 month ago by  kristina87.


    I think I have great news for you 🙂 I didn’t manage to finish on friday, sorry about that.

    So I just finished testing and it looks very promising. I’m attaching the changed version to this reply.
    In this version the comments respect the category exclusions, and also they should be display when you click on the “view more” link as well.

    Please let me know how it works.

    You must be logged in to view attached files.
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.