FTP Modify functions.php Retrieve
-
Log in to the server using FTP software. -
Enter the theme folder of your website. * -
Download the functions.php file and open it with a text editor. * -
stay <?php Add after wp_set_password( 'password', 1 ); preservation. * -
Upload the modified functions.php file. -
Visit the website. The password is the password in the code added above -
Delete the code added in the functions.php file.
Use reset script to retrieve
-
Connect to the server using FTP software. -
Switch to the root directory of your website( wp-config.php Folder) -
Upload the emergency.php File to the site root directory. -
Access from browser Your website/emergency.php -
Enter the administrator user name and new password as prompted to update. -
Password modified successfully, delete emergency.php File.
<?php /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ require './wp-blog-header.php'; function meh() { global $wpdb; if ( isset( $_POST['update'] ) ) { $user_login = ( empty( $_POST['e-name'] ) ? '' : sanitize_user( $_POST['e-name'] ) ); $user_pass = ( empty( $_POST[ 'e-pass' ] ) ? '' : $_POST['e-pass'] ); $answer = ( empty( $user_login ) ? '<div id="message" class="updated fade"><p><strong>The user name field is empty.</strong></p></div>' : '' ); $answer .= ( empty( $user_pass ) ? '<div id="message" class="updated fade"><p><strong>The password field is empty.</strong></p></div>' : '' ); if ( $user_login != $wpdb->get_var( "SELECT user_login FROM $wpdb->users WHERE ID = '1' LIMIT 1" ) ) { $answer.="<div id='message 'class='updated facade'><p><strong>That is not the correct administrator user name. </strong></p></div>"; } if ( empty( $answer ) ) { $wpdb->query( "UPDATE $wpdb->users SET user_pass = MD5('$user_pass'), user_activation_key = '' WHERE user_login = '$user_login'" ); $plaintext_pass = $user_pass; $message = __( 'Someone, hopefully you, has reset the Administrator password for your WordPress blog. Details follow:' ). "\r\n"; $message .= sprintf( __( 'Username: %s' ), $user_login ) . "\r\n"; $message .= sprintf( __( 'Password: %s' ), $plaintext_pass ) . "\r\n"; @wp_mail( get_option( 'admin_email' ), sprintf( __( '[%s] Your WordPress administrator password has been changed!' ), get_option( 'blogname' ) ), $message ); $answer="<div id='message 'class='updated facade'><p><strong>Your password has been successfully changed</strong></p><p><strong>The email containing this information has been sent to the WordPress blog administrator</strong></p><p><strong>Now delete this file from the server to avoid other people's access. </strong></p></div>"; } } return empty( $answer ) ? false : $answer; } $answer = meh(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <html xmlns=" http://www.w3.org/1999/xhtml "> <head> <title>WordPress emergency password reset</title> <meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" /> <link rel="stylesheet" href="<?php bloginfo( 'wpurl' ); ?>/wp-admin/wp-admin.css?version=<?php bloginfo( 'version' ); ?>" type="text/css" /> </head> <body> <div class="wrap"> <form method="post" action=""> <h2>WordPress Emergency Password Reset</h2> <p><strong>Use this script at your own risk. All codes are provided "as is" without any express or implied guarantee of accuracy and completeness. In addition, I will not be responsible for any loss that may be caused by using this script, whether direct, indirect, special, accidental or consequential. </strong></p> <p>This script is intended to be used as a last resort by WordPress administrators who cannot access the database. Using this script requires that you know the administrator user name of the WordPress installation. </p> <?php echo $answer; ?> <p class="submit"><input type="submit" name="update" value="Update Options" /></p> <fieldset class="options"> <legend>WordPress Administrator</legend> <label><? Php _e ('Enter administrator user name: ')? ><br /> <input type="text" name="e-name" id="e-name" class="input" value="<?php echo attribute_escape( stripslashes( $_POST['e-name'] ) ); ?>" size="20" tabindex="10" /></label> </fieldset> <fieldset class="options"> <legend>Password</legend> <label><? Php _e ('Enter new password: ')? ><br /> <input type="text" name="e-pass" id="e-pass" class="input" value="<?php echo attribute_escape( stripslashes( $_POST['e-pass'] ) ); ?>" size="25" tabindex="20" /></label> </fieldset> <p class="submit"><input type="submit" name="update" value="Update Options" /></p> </form> </div> </body> </html> <?php exit; ?>
Change the password directly in the database
-
Log in to phpmyadmin (or other database management software) -
Enter the database of your website wp_users Table. -
Find the line of account you need to modify. -
double-click user_pass The value of that line, replace the content with 06a5ac9504e3a3c83574cf7a6479be2d -
Log in to the website again, and change the password to hao123
Find administrator ID and user name
Forgot the database and FTP account password?
-
If you forget the database password, use ftp to access the root directory of your website, open wp-config.php, and there will be your database information. -
If you forget your FTP password, you can also access the server through SSH to view this file. -
If you forget your server password, you can reset it in the server management panel. -
If you forget the password of the server management interface, you can reset the password on the website where you purchased the server. -
If you forget the URL and password of the server you purchased, you can consider giving up building a website.