Hiding restricted posts from search results

Hi – I’ve installed Groups Restrict Categories, restricted a certain post category to a certain group, and added some posts to it. The post headlines show up in my search results, but the content is hidden. Is there a way of hiding the headlines entirely, without making the posts private which does the trick but is an extra step for the admin?

Thanks!


Comments

4 responses to “Hiding restricted posts from search results”

  1. Thanks again George. Good idea – we’re not using a search plugin at the mo but maybe I can exclude the whole category by using one – will try that out…

  2. Either way it works, but if you restrict each post, they will disappear from the search results as well.
    Do you by any chance use a search plugin or a custom function/hook modifying the WP_query, with pre_get_posts or something similar?

  3. Thanks George – so just to confirm, there’s no way of tying this to the category, rather than having to set the groups on each individual post? That’s what I was hoping to avoid (i.e. making the only step the admin had to do be selecting the category). But we can live with it if it’s not possible!

  4. George Avatar

    Hi Trevor,

    Please add the capability of the restricted group to each one of the posts as well and try again.

    Kind regards,
    George

Share