WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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' ),
    'label_remember' => __( 'Remember Me' ),
    'label_log_in' => __( 'Log In' ),
    '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

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? – Tim Plummer Nov 1 '13 at 15:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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