Login Redirect To Home Page

It would be nice to have a plugin that after you login, it redirects you to the home page of the site. In development of Petomundo!, we are using BuddyPress. After a person logs in, it takes them to a stripped backend, (normal) but most of the features are on the frontend. So, not confusing the user with the backed of WP would be nice.

  • realsol

    I have a blog where I need users to be registered, but I didn't want them in the admin area. It was confusing users when the signed up.

    While I hated doing it, I editing the wp-admin.php to redirect to the home page if the user did not have 'Edit' rights.


    //wp-admin (about line 411)

    default:
    if ( isset( $_REQUEST['redirect_to'] ) )
    $redirect_to = $_REQUEST['redirect_to'];
    else
    $redirect_to = '/'/* admin_url() */;// RDG: no users in admin <- HERE IS ONE CHANGE

    if ( is_ssl() && force_ssl_login() && !force_ssl_admin() && ( 0 !== strpos($redirect_to, 'https') ) && ( 0 === strpos($redirect_to, 'http') ) )
    $secure_cookie = false;
    else
    $secure_cookie = '';

    $user = wp_signon('', $secure_cookie);

    if ( !is_wp_error($user) ) {
    // If the user can't edit posts, send them to their profile.
    if ( !$user->has_cap('edit_posts') && ( empty( $redirect_to ) || $redirect_to == 'wp-admin/' ) )
    $redirect_to = /*admin_url('profile.php')*/'/'; // RDG: no users in admin <- HERE IS THE OTHER
    wp_safe_redirect($redirect_to);
    exit();
    }

    Might help you until a specialized plug-in is created.