How to exclude or filter password protected posts when using next_post_link() previous_post_link
The function next_post_link() allow excludes, with the parameter excluded_terms. Add a list of the IDs of the password protected posts to this param. You get a list of all password protected posts with the follow example via DB select. $password_pages = $wpdb->get_col(“SELECT ID FROM $wpdb->posts WHERE post_status=”publish” AND post_type=”post” AND post_password !=””); Alternative can you … Read more