0

I am currently using a plugin called Sidebar Login which allows users to bypass the dashboard and go directly to the site. However, when users login via /wp-login.php (e.g. when they click on their verification links in their emails), they are once again sent to the dashboard. I would like for users to be able to click on their verification links and have them directed to the home page of the website where they can sign in through the sidebar login I have set up. Is this possible?

1 Answer 1

2

You can achieve this by using the Plugin Peter's Login Redirect. It allows you to send users to a specific page after login, based on the user capabilities. So you can allow administrators to go to the admin section, while members are redirected to the front page.

If you want to prevent users from ever seeing the admin, insert something like this to your functions.php, depending on which users you want to allow in the admin you may have to change the capability.

if ( is_admin() && !current_user_can('manage_options') ) {
    wp_redirect( get_bloginfo( 'url' ) );
}

You can also hook a redirect function to login_enqueue_scripts, to send every user calling the login page to the homepage (same structure as above).

1
  • Thanks, the plugin + function did the job. I entered the homepage url and now it redirects all users trying to login via /wp-login.php to the home page instead of the admin screen. Thank you!
    – Desi
    Commented Jan 17, 2013 at 21:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.