• Dear community,

    I installed IThemes Security and am aware of the huge potential it has for making my website protected against getting hacked. I do have a proplem/question though.

    My site is a Multisite setup.

    I used the function of the plugin to change the prefix of the database tables from “wp_” to somthing random the plugin was suggesting like “lsjfk_”. First the site kept working completely fine and it seemed all was functioning correctly. Now I cannot login into my site anymore, this problem exists for all user accounts. Using the “forgot password” link underneath the login form makes WP send a mail to my account with a reset password link. Following the link and changing to a new password works, but for some reason that new password does not seem to work in the end. I cannot access my admin dasboard with the new, changed password neither. I think it has something to do with having changed the database table prefix from “wp_” to something else.

    If you know what could have caused my issue and have a tip, I would highly appreciate it.

    Thank you for your support and best regards,
    Max

    • This topic was modified 8 years, 1 month ago by maxident.
Viewing 1 replies (of 1 total)
  • Thread Starter maxident

    (@maxident)

    Next to the password recovery not working I also had a problem with the wp mail function. So the forgot password mail did not even arrive, I had another support topic open for that question. A helpful user solved the mail issue by posting the below, which worked for me. At the same time it also fixed the problem I had with the password recovery, which I was asking about in this issue. So I post his fix here as well.

    ——————————————————————-

    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”;
    });

Viewing 1 replies (of 1 total)
  • The topic ‘after database prefix change, password recovery wont work’ is closed to new replies.