Hi,
Please paste this code at functions.php file of theme.
function exclude_protected($where) {
global $wpdb;
return $where .= ” AND {$wpdb->posts}.post_password = ” “;
}
// Decide where to display them
function exclude_protected_action($query) {
if( !is_single() && !is_page() && !is_admin() ) {
add_filter( ‘posts_where’, ‘exclude_protected’ );
}
}
// Action to queue the filter at the right time
add_action(‘pre_get_posts’, ‘exclude_protected_action’);
Thanks
Mohammad