relevanssi_show_password_protected

apply_filters( 'relevanssi_show_password_protected', boolean $show, int $post_id )

By default, Relevanssi blocks password-protected posts from the search results. However, you can use this filter hook to include them.

Parameters

$show
(boolean) If true, allow password-protected posts in the results.

$post_id
(int) Post ID, so you can control this based on the post.

More information

Relevanssi used to work like WordPress Core and include password-protected posts in the search results. After all, the password-protected posts are public; their content is just hidden behind a password. Relevanssi would not show any excerpts or let anyone unauthorized see the post content.

This changed in version 4.23 (2.26 for Premium). Now, password-protected posts are removed from the search results unless explicitly allowed with this filter hook. This is because having password-protected posts in the results can allow a clever hacker to figure out the contents of the posts based on guesses confirmed with search results.

It seems unlikely that someone can glean useful information this way, but it’s possible. That’s why you now need to explicitly allow password-protected posts. You can do it like this:

add_filter( 'relevanssi_show_password_protected', '__return_true' );