• Hi there

    Is it possible to exclude custom posts from search results, I have some posts, which is restricted to view if you are a subscriber. It keeps showing in search results – can I prevent that?

Viewing 1 replies (of 1 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Yes, you can. The key to this is the relevanssi_post_ok filter hook, which can be used to control who gets to see what in the results. All it takes is a function that given the post ID and the current user can tell whether the user can see the post or not. See the filter documentation here.

Viewing 1 replies (of 1 total)

The topic ‘Show result based on users’ is closed to new replies.