1) You need to include postmeta into query that you’re using for archive pages in a kind of this way:
add_filter('getarchives_join', 'my_archives_join_filter');
function my_archives_join_filter($join) {
if (!is_user_logged_in()) {
global $wpdb;
return $join . "LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id)";
}
return $join;
}
2) You need to include condition to select a post with specific metafield in this way:
add_filter('getarchives_where', 'my_archives_where_filter');
function my_archives_where_filter($where_clause) {
if (!is_user_logged_in()) {
global $wpdb;
$where_clause = "WHERE $wpdb->posts.post_type="post" AND $wpdb->posts.post_status="publish"";
return $where_clause . "AND $wpdb->posts.meta_key = 'private_page' AND $wpdb->posts.meta_value="0"";
}
return $where_clause;
}
Code where not tested for your specific case. But the approach in general should be clear.
UPDATE: where curious enough to test an approach. All works 😉