How to Reset/Recover Admin User and Password your website (WordPress, Magento)

How to Reset_Recover Admin User and Password your website (WordPress, Magento)
Last updated on

We will guide you to reset and recover your administrator username and password of your WordPress, Magento website.

What would you do when you forget, lose or get your admin panel hacked. In this article, we guide you to reset your admin user and password for WordPress, Magento… as long as your website uses PHP programming language.

There are many ways to reset password or restore admin account for your website, but we will give you the two most simple and effective methods. It is to restore via admin email and phpMyAdmin (Database).

1. Restoring username and password using your admin email

As you know, all websites login page has a “reset password” or “forgot your password” section in case you lose your password. In the event that you forget your login password to the admin panel then there’s no need to be worried. Because you can restore your admin account within a few simple steps.

Firstly, open the admin panel login page (admin panel URL default)

  • With WordPress: http://yourdomain.com/wp-admin
  • With Magento: http://yourdomain.com/admin
  • With Joomla: http://yourdomain.com/administrator
  • etc

Then, click Lost your password? (WordPress),

Lost your password WordPress

Forgot your password? (Magento).

Forgot your password Magento Admin Panel

In the next screen (Forgot Password), you type your admin account’s email correctly in the box of Username or Email Address (WordPress),

Get New Password Admin WordPress

Email Address (Magento).

Retrieve Password Magento

Then, click on Get New Password (WordPress), Retrieve Password (Magento).

Then, your login information to the admin panel (including username and password) will be sent to your email. You just need to click on the link in your email to reset the login information.

WordPress Password Reset via Email

This way of restoring your username and password has both advantage and disadvantage.

– Advantage: it is the simplest way, is finished in a few minutes and always successful in most cases.

– Disadvantage: sometimes this method doesn’t work due to 3 following reasons:

  • You forget your email
  • The mail sending function of the server doesn’t work
  • The function of restoring password via email is disabled

2. Resetting your admin password using phpMyAdmin (Database)

– Advantage: 100% successful
– Disadvantage: Quite complicated. You also need to have an understanding of server, cPanel, phpMyAdnin…

Firstly, you must have a Hosting Panel, VPS (or Dedicated Server)… admin account credentials of the website. Log in and scroll to Databases section (phpMyAdmin). Then, you need to find the correct Database (DB) of the website whose login information you forget.

phpMyAdmin Access DB on cPanel

If you have many DB in phpMyAdmin then you can specify the correct DB (username and password) associating with the website which you forget the login information by:

– With WordPress:

You have to use File Manager (in cPanel) or FTP, open wp-config.php in the root directory of your website. Find the line containing database information of the website (line 22-29 với WordPress version 4.9+):

/** The name of the database for WordPress */

define('DB_NAME', 'yourDBname);

/** MySQL database username */

define('DB_USER', 'yourUsername);

/** MySQL database password */

define('DB_PASSWORD', 'yourPassword');

– With Magento:

You also use File Manager or FTP to open the file of file app/etc/local.xml (Magento version 1x), line 44-46:

<username><![CDATA[yourUsername]]></username>

<password><![CDATA[yourPassword]]></password>

<dbname><![CDATA[yourDBname]]></dbname>

Next, you login phpMyAdmin with your username and password that you have in the above steps (normally you don’t have to re-login phpMyAdmin. When you login cPanel then it will redirect you to phpMyAdmin page). Then go to Database (already shown in the above steps) of your website to change your username and password.

You need to find the table containing your admin panel’s username and password:

– With WordPress:

The default name of the table is wp_users but some people might configure and change the table’s name to increase the security of WordPress website => the table’s name is different at the prefix but still contains _users. You can see the user_login column (username) and user_pass (password), but they are already encoded by MD5.

WordPress resetting admin username and password using phpMyAdmin

Choose the username whose password you want to reset and click on EDIT button on the left side. In the box of Value of user_pass field, fill out the desired password. In the box of Function of user_pass choose MD5 options (picture). Then you click on Go at the right bottom.

Reset admin password using phpMyAdmin

– With Magento:

The default table admin_user (the name contains the prefix but still contains _admin_user).

Admin user table DB Magento

You will see the username column and password of the username, but they are already encoded with MD5. Select the username that you want your password to be reset. Then follow the same steps as above (with WordPress) with password field. Finally, click on Go button.

You’re done. Now you can open the admin panel of your website and check the result 🙂

Here is the video demonstration for actions:

Tips: you can reset password of the username with SQL query (in SQL tab), please see the picture below:

SQL Query reset password

– With WordPress:

UPDATE `wp_users` SET `user_pass` = MD5( 'yourPassword' ) WHERE `wp_users`.`user_login` = "yourUsername";

– With Magento:

UPDATE admin_user SET password=CONCAT(MD5('qXyourPassword'), ':qX') WHERE username='yourUsername';

“yourPassword” – replaced by your desired password.
“yourUsername” – replaced by the username whose password you want to change

In the event that you have any problems taking back your website’s username and password, please feel free to contact us. We are pleased to help you!




Post a Comment

Please keep in mind that all comments are read and moderation.
Your email address WILL NOT be published. Please DO NOT use keywords in the Real Name field. Thank you !




    1 Comment

Get $100 Free from Vultr to accelerate your website and application Register a Domain Name on Namesilo


Categories