WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have been trying to reset my admin password for my local install of wordpress running on MAMP. Previously had been working fine but I forgot the password but when I go through the process of 'Lost your password' I am meant to get an email with new password but it never arrives in my hotmail (also checked the junk) I know these can sometimes take a while to come through but it has been a day now.. Any ideas I could try?


share|improve this question
up vote 1 down vote accepted

Probably you dont have any mail server installed/enabled (like sendmail/qmail/postfix) in your local machine. You can still reset your admin password from database. The table "wp_users" stores the password in the "user_pass" field

You can just replace the value with a md5 hash value of your desired password for the admin user.

Note: This is good for test/local environments and dont do so in Production server because it invalidates the effect of salt :)

share|improve this answer
:-/ strange I tried changing it to MD5 function and changing the password in phpmyadmin a couple of times and it is still saying my password is wrong :-/ – NATHAN C Mar 23 '13 at 17:29
Sorry my bad, was using wrong database lol. Useful info especially about the effect on salt thanks :) – NATHAN C Mar 23 '13 at 17:33

You can reset the password via code also. Below are the steps:

Paste the below code in your active theme's functions.php file.


Put in your own new password for the main admin user. The "1" is the user ID number in the wp_users table.


share|improve this answer
Thanks man, this is also really good to know :) – NATHAN C Mar 23 '13 at 17:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.