Combine get_page_by_title to exclude pages from wp_list_pages
get_page_by_title() source code shows it runs a single mysql query. You can streamline your two calls of the function to be just one query by writing a custom one: global $wpdb; $qry = “SELECT ID FROM $wpdb->posts WHERE (post_title = %s OR post_title = %s) AND post_status=”publish””; $sql = $wpdb->prepare($qry, ‘title1’, ‘title2’ ); $res = … Read more