Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I changed the wp-login.php url to /login/ so all links in registration and forgot password emails have /login/ rather than wp-login.php.

The problem now is that when I visit /wp-admin/ or click on the dashboard once logged in, it starts by going to wp-login.php?redirect_to... and then goes to /login/.

How can I fix it to keep the custom login url but also access wp-admin?

Functions.php

add_filter('site_url',  'wplogin_filter', 10, 3);
function wplogin_filter( $url, $path, $orig_scheme )
{
 $old  = array( "/(wp-login\.php)/");
 $new  = array( "login");
 return preg_replace( $old, $new, $url, 1);
}


add_filter( 'lostpassword_url', 'custom_lostpass_url' );
function custom_lostpass_url( $lostpassword_url ) {
    return get_option('siteurl'). '/forgot-password/';
}
share|improve this question
    
I should add that /login/ is a custom page template that has a custom login form. Is there certain functionality I need to add for wp-admin on that page? –  Dave Feb 5 '13 at 11:59

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.