Take the 2-minute tour ×

Any user that is not an admin is not being redirected to the defined URL with an instance of wp_login_form().

$args = array(
    'echo' => true,
    'redirect' => site_url( '/chat/' ), 
    'form_id' => 'loginform',
    'label_username' => __( 'Username' ),
    'label_password' => __( 'Password' ),
    'id_username' => 'user_login',
    'id_password' => 'user_pass',
    'id_remember' => 'rememberme',
    'id_submit' => 'wp-submit',
    'remember' => true,
    'value_username' => NULL,
    'value_remember' => false );

wp_login_form( $args );

When I log in as an admin, it works fine. When I use a test subscriber or editor account, it redirects to the home page.

share|improve this question
add comment

1 Answer

It should work, I use the login_redirect filter to achive what you want. There is a good example on the page, taking different logged in user roles into account. Check it out.

share|improve this answer
Just found it. Issue was a plugin conflict with Pie Register. Looked over login_redirect filter. Looks handy. I assume Pie Register is using this somewhere in their plugin. They have a redirect after registration setting, tried changing that and issue persisted. Do you need to flush the filters like you do with permalink rules? –  tPlummer Nov 1 '13 at 15:28
add comment

Your Answer


