Code-Snippets-Functions/Execute a function on a child site/Relevanssi/exclude-protected-posts.txt

7 lines
267 B
Text

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;
}