• Resolved whdsolutions

    (@whdsolutions)


    Is there a way that when you log out you are redirected to the homepage rather than the standard WP login page?

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

Viewing 1 replies (of 1 total)
  • Hi @whdsolutions,

    Here is a piece of code that you can just copy and paste in your child theme’s functions.php file and it will redirect you to the desired page which is the homepage.

    You can find more filters for Login Logout Menus [ Helping Link ]

    /**
      * Filter to redirect a user to a specific page after logout.
      * @return [URL] logout URL with page slug on which it will be redirected after logout
      */
     add_filter( 'login_logout_menu_logout', 'loginpress_login_menu_logout_redirect' ); 
     function loginpress_login_menu_logout_redirect() {
      return wp_logout_url( '/' );
    }

    Let me know if this works for you.

    Thank You.

    Login Logout Menu Filters – LoginPress
    https://loginpress.pro

Viewing 1 replies (of 1 total)
  • The topic ‘Log out to homepage’ is closed to new replies.