How can I reset a Local site's WordPress admin password?


#1

In case you imported a site that you do not have an admin login for or you simply forgot your admin password, here’s how you can gain access to the WordPress admin for a Local site on your computer.


Method A: Use WordPress’ Lost your password? option

This requires that you know either the username or e-mail used for an admin account on the site.

  1. Visit the site’s WordPress Admin login page by clicking on “Admin” beside “View Site” in Local

  1. Click “Lost your password?”
  2. Enter either the username or e-mail of an account that you know is an admin.
    • Note: If you created this site in Local from scratch, the default admin e-mail is dev-email@flywheel.local.

  1. Go to the site’s “Utilities” tab in Local
  2. Click “MailHog” or “Mailcatcher” depending on the site’s Environment

  1. Find the password reset e-mail and click the link at the bottom

  1. Follow the prompt to reset the password and login!

Method B: Use WP-CLI

This method is best for creating new admin accounts in case you don’t know an existing admin username/e-mail.

  1. Right-click on the site in Local’s sidebar and go to “Open Site SSH”

  1. Enter wp user create USERNAME EMAIL@OFCHOICE.LOCAL --role=administrator
    • Replace the USERNAME and EMAIL@OFCHOICE.LOCAL with the desired username and e-mail.
    • A random password will be generated after the command is ran. If you wish to define a password, you can add the --user_pass argument like so: wp user create USERNAME EMAIL@OFCHOICE.LOCAL --role=administrator --user_pass=PASSWORD

  1. All done! Try logging into the WordPress admin with the newly created account.

If you’re curious about WP-CLI and want to learn more, see https://developer.wordpress.org/cli/commands/


Local Site Wordpress Login
Updated Virtualbox, now Site Admin Button is not Working