• Dear community,

    IThemes security is a very powerful plugin and Im a big fan. Nevertheless I have an issue and hope you can help. I used the plugins′option to hide the wp-admin and wp-login page using something else lets say “www.mydomain.com/xyz-log” for example. This works perfectly fine, but if a user does not remember his password and clicks the “forgotten password” link underneath the login the 404 error page is displayed and not the either the message “an email with the link to reset password has been sent to your mail” or “your email does not appear in our database” as it normally would do. As soon as I deactivate the plugin or set back the wp-login bzw. wp-admin page back to its original setting the “forgot password” option works perfectly fine again. (so it is no issue with the wp mailing function).

    If you know why this is happening and have a fix I would highly appreciate your input.

    best greetings,
    Max

Viewing 5 replies - 1 through 5 (of 5 total)
  • @maxident

    Multi site ?

    Thread Starter maxident

    (@maxident)

    Yes it is a Multisite setup, sorry for not mentioning that right away.

    I had the same issue on my multiside.
    Digged up this solution, but can’t remember where I found it.

    I planted this into the functions.php of my child theme:

    
    // fixes "Lost Password?" URLs on login page
    add_filter("lostpassword_url", function ($url, $redirect) {	
    	
    	$args = array( 'action' => 'lostpassword' );
    	
    	if ( !empty($redirect) )
    		$args['redirect_to'] = $redirect;
    
    	return add_query_arg( $args, site_url('wp-login.php') );
    }, 10, 2);
    
    // fixes other password reset related urls
    add_filter( 'network_site_url', function($url, $path, $scheme) {
      
      	if (stripos($url, "action=lostpassword") !== false)
    		return site_url('wp-login.php?action=lostpassword', $scheme);
      
       	if (stripos($url, "action=resetpass") !== false)
    		return site_url('wp-login.php?action=resetpass', $scheme);
      
    	return $url;
    }, 10, 3 );
    
    // fixes URLs in email that goes out.
    add_filter("retrieve_password_message", function ($message, $key) {
      	return str_replace(get_site_url(1), get_site_url(), $message);
    }, 10, 2);
    
    // fixes email title
    add_filter("retrieve_password_title", function($title) {
    	return "[" . wp_specialchars_decode(get_option('blogname'), ENT_QUOTES) . "] Password Reset";
    });
    
    • This reply was modified 8 years, 1 month ago by Ulme.
    Thread Starter maxident

    (@maxident)

    Hi Ulme,

    thank you for your response, this sounds promising. Tried to implement the code how is it and it did not work. Do I have to change some of the URLs in the code you posted with my actual URLs for it to function?

    Thanks for your support,
    Max

    Thread Starter maxident

    (@maxident)

    Nope, It was my mistake since I forgot to close the last bracket…

    Ulme you are a star, this worked for me, the “lost password” mail function works fine now together with my personalised login and admin page! You saved my day!

    Thanks a lot!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Login and wp-admin hide, wp mail function not functional’ is closed to new replies.