How restrict page for users logged? [closed]

Programmatically, you’d be looking for is_user_logged_in(). You’d want to put this in your header.php, or on the page itself:

if ( is_user_logged_in() ) {
    // user logged in, redirect
    // One way to redirect is: 
    // wp_redirect('http://YOURSITE.com/');
    exit();
} else {
    // user not logged in, nothing
}

Otherwise, if you’re just looking for a plugin: https://wordpress.org/plugins/peters-login-redirect/

Leave a Comment