• Resolved manariba

    (@manariba)


    I have the option “Enable Private Site” checked, but at the login page, there’s a long URL (wp-login.php?redirect_to=https%3A%2F%2F…) visible behind the web url. How can this be hidden so only the web url is shown?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Plugin Author Caseproof

    (@caseproof)

    Hi @manariba

    When you enable Private Site in Members, not-logged in users are redirected to login page in WordPress Dashboard. There is a redirect_to param to redirect users to front-end page. We don’t have any option to disable this parameter. If you have any plugin that allow you to have Login page on front-end, you could disable Private Site and then add this code snippet at the end of your theme’s functions.php file:

    add_action( 'template_redirect', function() {
      $user = wp_get_current_user();
      if ( !is_page( 'login' ) && ( ! is_user_logged_in() || ( ! empty($user) && in_array( 'administrator', (array) $user->roles ) ) ) ) {
        $redirect = 'https://your-domain.com/login';
        wp_redirect( $redirect );
        exit;
      }
    } );

    The login page would be the page where you can add login form shortcode.

    I hope that helps.

Viewing 1 replies (of 1 total)
  • The topic ‘Remove redirect url in option “Enable Private Site”’ is closed to new replies.