How to reset WordPress admin password


A day, we can’t login to wp-admin, because of our website is hacked or a long time ago we don’t logged in… We can’t reset the password via email. How to reset WordPress admin password? Follow theses steps:

Step 1: Goto Phpmyadmin to view the admin’s ID. Here is 1
phpmyadmin

Step 2: goto file index.php
index wp

Add line:

wp_set_password( "the new pass", 1 ); 

add line index

Step 3: Access your website: yoursite.com

Step 4: Comment file or remove the line we’ve added

#wp_set_password( "123456", 1 ); 

Done!

Leave a Reply