Hello Magento Friends,

In today’s blog, I will explain How to Reset Customer Password using Console Command in Magento 2.

With default Magento 2, when an admin requests a reset password for the customer, Magento will send a reset password link in the customer’s email and request them to create a new password. But if the customer is unable to receive emails, the below method will help reset the customer’s password in Magento 2 easily.

Steps to Reset Customer Password using Console Command in Magento 2:

Step 1: First, we need to create a “di.xml” file inside the extension etc directory of our extension.

app\code\Vendor\Extension\etc

Then add the below code

Step 2: After that, we need to create a “Changepasswordcommand.php” file inside the extension at the following path.

app\code\Vendor\Extension\Command\

Now add the below-mentioned code

Step 3: Run the Magento upgrade and deploy command after adding both files. Once done with the Magento command, you need to run the below command to reset a specific customer password.

Conclusion:

Hence, using the above steps, you can smoothly Reset the Customer Password using Console Command in Magento 2. Admin can even change Customer Password Programmatically in Magento 2.

If you face any error while implementing the code, share it with me through the comment box, and I will quickly provide you with a solution. Share the tutorial with your friends, and stay in touch with us to learn more.

Happy Coding!

Click to rate this post!
[Total: 2 Average: 5]