Exclude protected posts from indexing in Relevanssi

Exclude protected posts from indexing in Relevanssi on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'relevanssi_indexing_restriction', 'rlv_exclude_protected' );
function rlv_exclude_protected( $restriction ) {
	global $wpdb;
	$restriction['mysql']  .= " AND post.post_password = ''";
	$restriction['reason'] .= ' Has a password';
	return $restriction;
}

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.