Cannot Login To WordPress? – Emergency Password Reset Options

Ever lost or forgot your username or password and as a result cannot login? Normally its easy to reset your password if you’re using WordPress however there are times when this may not be possible for a variety of reasons.

Sometimes when you play around with php files and start editing code it can cause all sorts of login problems.

Depending on what sort of access you have, here’s a list of all the known methods to reset your WordPress password so you can login and continue blogging:

  1. Using the WordPress reset option on your login page
  2. Using PhpMy Admin if you have cPanel Access
  3. Using cPanel or FTP to add a line of code to your public_ html root directory
  4. Using the emergency password reset script

Reset WordPress Password by e-mail

This is the easiest way to reset your WordPress password using the automatic reset option available on your login page.

  • Go to http://yoursite.com/login.php (replace yoursite.com with your domains URL)
  • Click on the lost password link
  • Enter your username or the e-mail address for your user account.
  • You will receive a link by e-mail
  • Click on the Password Reset link in the e-mail
  • You will then be taken to a screen to reset your password
  • Enter your new password and confirm it by entering it again
  • You can now login with your new password

Reset Password in PhpMyAdmin

If for some reason you cannot login after trying the login page lost password link to reset your password by e-mail then you can try this method using phpmyadmin.

  • Login to your web hosting accounts cPanel (These details will be in the e-mail you received when you opened your hosting account)
  • Scroll down to the Databases section
  • Click on the phpmyadmin icon
  • Click on the database name for your site ( located in the left hand column)
  • Scroll down to wp_users
  • Click wp_users and locate your user details (which will be at the top of the list of users)
  • Click on edit and locate your user_pass
  • Delete the long string of letters & numbers and replace it with your new password
  • Click the drop down menu and select MD 5
  • Click the Go button and try and login using your new password

Resetting Password via FTP or Cpanel

This method involves adding a simple line of code to your current themes function.php file. You can do this using FTP or cPanel. I recommend cPanel as it provides a built in text editor for editing PHP files. If you prefer using FTP you can also use notepad++ as your text editor.

You can also use the built in FTP program located in cPanel under Unlimited FTP if your web host offers this otherwise Filezilla or a Firefox addon named FireFTP are good free FTP programs to use.

  • Login to cPanel and locate the Files section
  • Click on File Manager and go to your public _html root directory for your site
  • Locate your themes directory and click it
  • Locate and right click on your functions_php file
  • Click code edit and open the file (maybe different depending on your hosts cPanel setup)
  • Paste the  line of code below into the file immediately after the first <?php: at the top of the file
wp_set_password('password',1);

Replace password in the above code with your new password and click the save button at the top

Make sure you remove this line of code after you have successfully logged in or it will continue to reset your password every time you load a new page on your site.

Emergency Password Reset Script

Using this method is the easiest in my opinion as you simply copy this code into notepad and save it as a emergency.php file then upload it using FTP or cPanel to your public_html root directory for your domain.

You must know your username to use this password reset method

  • Login to cPanel and scroll down to File Manager
  • Click File Manager and go to your site public_html root directory
  • Copy and paste the code below into notepad and save it as emergency.php
  • Click on upload in cPanel and upload the emergency.php file to your root directory (if you have multiple sites make sure you upload it to the root directory for the domain you cannot login to)
  • Refresh the page and enter http://yoursite.com/emergency.php in your browsers address bar
  • You should now get a login screen where you can enter your existing username and a new password of your choice
  • Once you have entered these details you should now be able to login
  • You will also receive an email to the users e-mail address with your new password details

DELETE this file from your server immediately after you have successfully logged in for security reasons.

That’s all i have for you on solving login problems and resetting passwords for WordPress users. If you’re still having problems, the WordPress.org forum should be able to help or contact me and i’ll have a go for you.


Comments

10 responses to “Cannot Login To WordPress? – Emergency Password Reset Options”

  1. I did mine followed the emergency.php tutorial even though the password changes i am still not able to login. Please any help here?

    1. Brad Dalton Avatar
      Brad Dalton

      Used this method dozens of times and it always works.

      1. Jenna Langley Avatar
        Jenna Langley

        Hello again.

        I’m sorry it took me so long to reply.
        I m able to login fine now. I uploaded the reset script…amazingly simple as I only know a fraction of how to do that stuff.

        Thanks again for all of your help and time.

        Take care. 🙂

        Jenna

        1. Brad Dalton Avatar
          Brad Dalton

          Thanks for letting me know Jenna.

  2. Jenna Avatar

    Hi, Sorry to post this here, but I can’t login to any WordPress forums even if I try to make a new temporary account just to ask a question with.

    How can I fix a problem with logging into WP forums? I am trying to respond to EngageWP who helped me out, but the forum says I have an incorrect password when I try to get into the forums, and the password reset doesn’t work.

    Thanks so much-I really need some help 🙂
    Jenna

    1. Brad Dalton Avatar
      Brad Dalton

      Try to reset your password.

      1. Jena Langley Avatar
        Jena Langley

        Hi. Thank you so much for the fast reply. It won’t let me reset my password for some reason, I never get the email it says it sent me, and I know it’s the right email.Is there a way to fix this?

        Thank you…I am totally lost why I can’t reset it, I’ve reset it once in the past wth no problem.

        Thanks.
        Jena

        1. Brad Dalton Avatar
          Brad Dalton

          Do you have a problem with logging into your WordPress installation?

          If so, you can upload the emergency password reset script to the root directly of your WordPress installation which will send you a password reset email.

          1. Jenna Langley Avatar
            Jenna Langley

            I will give that a try. Thank you very much for all of your help. 🙂

            Take Care,
            Jenna

          2. Brad Dalton Avatar
            Brad Dalton

            Let me know how you go because i’m interested what the problem is. Thanks Jenna

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.