Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @kanrup

    1. First of all make sure that Your site url is set properly in admin :

    Log in to your WordPress dashboard if possible.

    Go to Settings > General.Make sure that both the WordPress Address (URL) and Site Address (URL) are set correctly. Both should be set to https://heatherhillhall.com or whatever your actual site URL is.

    ==================================================================

    2. If you are not able to login then using PHP code also you can reset Password for your user .

    For that using File manager / Cpanel , go to wp-content/themes/yourtheme/functions.php file , add below code ,

    Replace ‘exampleuser‘ with the actual username or email .

    Replace ‘new_secure_password‘ with your desired password.

    function reset_user_password() {
    // Specify the username or email of the user
    $user_login = 'exampleuser'; // Change this to the username or email address

    // New password you want to set
    $new_password = 'new_secure_password'; // Replace with the new password

    // Get the user object by username (you can also use email)
    $user = get_user_by('login', $user_login);

    // If the user exists
    if ($user) {
    // Set the new password
    wp_set_password($new_password, $user->ID);

    // Optionally, you can send an email notification about the password change
    wp_mail(
    $user->user_email,
    'Your Password Has Been Reset',
    'Hello, your password has been successfully reset. If you did not request this change, please contact support.'
    );

    echo 'Password has been successfully reset for user: ' . $user_login;
    } else {
    echo 'User not found.';
    }
    }

    // Call the function to reset the password
    add_action('init', 'reset_user_password');

    After the password is reset, remove or comment out the code from the functions.php file to avoid unnecessary execution.

    Thanks.

    Moderator James Huff

    (@macmanx)

    You can change the siteurl and home values back following the steps at https://developer.ww.wp.xz.cn/advanced-administration/upgrade/migrating/#changing-the-site-url

    I recommend the steps specifically under “Changing the URL directly in the database.” You’ll find phpMyAdmin in your hosting account’s control panel.

    While you’re in the database with phpMyAdmin, you can also change your password following these steps: https://ww.wp.xz.cn/documentation/article/reset-your-password/#through-phpmyadmin

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘password reset link does not work.’ is closed to new replies.