The goal is so they can log in to WordPress but then browse the site as a normal user but not have to enter passwords for password protected pages.

I am just using the built in password protection WordPress provides on pages and posts, via the visibility setting under the publish options.

There are about 80 pw protected pages each with a different password so the cookie that WP uses won’t work in this situation either.

1 Answer
1

Since 4.7 you can filter the post_password_required function:

function my_admins_dont_need_password( $required ) {
    if ( current_user_can( 'manage_options' ) ) {
        $required = false;
    }

    return $required;
}
add_filter( 'post_password_required', 'my_admins_dont_need_password' );

Replace manage_options with whatever capability you want to use to allow users to skip the password form.

Leave a Reply

Your email address will not be published. Required fields are marked *