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?


4 Responses to Hiding restricted posts from search results

  1. Trevor July 10, 2015 at 10:51 am #

    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. George July 10, 2015 at 9:01 am #

    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. Trevor July 10, 2015 at 7:02 am #

    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 July 9, 2015 at 8:32 pm #

    Hi Trevor,

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

    Kind regards,

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account