Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
localhost

How to Reset a WordPress Admin Password on localhost

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If you can access the account email and your local WordPress setup can deliver mail, start with the login page’s Lost your password? link. If email recovery cannot work, use WP-CLI if it is available; otherwise reset the password through the local database interface. Check the site, database, table prefix and account carefully before changing anything.

Choose the recovery method that fits your access

Method What you need Best fit Main caution
Lost-password email Access to the account email and working local mail delivery Normal account recovery is available Local email delivery may not be configured
WP-CLI Terminal access and WP-CLI configured for this site You are comfortable using the command line Target the correct site and avoid exposing a displayed password
Database interface Access to the local database tool, such as phpMyAdmin Email and WP-CLI are unavailable Verify the database, table prefix and account; back up first
Direct MySQL Database credentials and command-line experience An experienced operator needs direct control WordPress documentation identifies direct database changes as high risk
Temporary recovery code or script Access to the WordPress files and ability to edit PHP Last-resort recovery Remove the code or script immediately after use

Try the WordPress password-reset email first

  1. Open the local site’s WordPress login page and select Lost your password?.
  2. Enter the account’s username or email address and submit the form.
  3. Follow the reset link if the message arrives.

This route is simplest when you know which email is on the account and your local environment can send mail. If no message arrives, switch to a method that uses access to the WordPress files or database rather than repeatedly submitting the form. [WordPress password-reset guidance]

Reset the password with WP-CLI

When WP-CLI is installed and configured for the local site, it is the preferred technical option. The WordPress Developer Resources handbook says, “WP-CLI provides a secure, command-line method for password resets without directly modifying database tables.” The handbook lists that page as last updated July 1, 2026. [WP-CLI reset-password command] [WordPress password-reset security guidance]

  1. Open a terminal in the WordPress installation directory. If the site is elsewhere, use WP-CLI’s global --path=<path> option to point to its files.
  2. If you need to identify the account, list the site’s users with wp user list, checking the login or ID before proceeding.
  3. Reset the intended user with wp user reset-password USER, replacing USER with the account’s login or ID. By default, WP-CLI emails the user.

To suppress the email notification, add --skip-email. To display the generated password in the terminal, add --show-password; treat that output as a secret because terminal logs, screenshots or shared sessions may expose it. In a multisite installation, specify the target site with WP-CLI’s global --url=<url> option. [WP-CLI reset-password command]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black
  • KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
  • EASY SETUP: Experience simple installation with the USB wired connection
  • VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
  • SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
  • FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.

If you need to set a password you choose, WP-CLI can prompt for it without putting the value directly into shell history: wp user update USER --prompt=user_pass. [WP-CLI user update command]

Change the password in phpMyAdmin or another database interface

  1. Open the database used by this WordPress installation—not a different local project’s database.
  2. Find the users table. Its common name is wp_users, but installations can use another table prefix.
  3. Locate the intended account by its login, then edit its user_pass value.
  4. In the interface’s function selector, choose MD5, enter the temporary new password, and save the change. Do not store plain text in the hash field without selecting the function.

WordPress accepts this temporary MD5 value for login and replaces it with a stronger hash after a successful sign-in. Before saving, confirm the database, prefix and account; back up the database if you are unsure. A wrong selection can change the wrong account or data. [WordPress password-reset guidance] [WordPress password-reset security guidance]

Rank #2
Sale
Logitech MK270 Full Size Wireless Keyboard and Mouse Combo - Black
  • Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
  • Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
  • Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
  • Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
  • Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites

Use direct MySQL edits only if you are experienced

WordPress documents changing user_pass through a MySQL client, but direct database changes carry more risk than WP-CLI or a familiar database interface. If you take this route, back up the database first and verify the table prefix and exact user before making an edit. [WordPress password-reset guidance] [WordPress password-reset security guidance]

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Reserve temporary PHP recovery code for a last resort

WordPress’s guide describes a method that temporarily adds a wp_set_password call to the active theme’s functions.php. That code resets the password on every page load until removed, so delete the added code as soon as you regain access. The guide also covers an emergency PHP script; delete it immediately after use because someone else could use an exposed script to change the password. Prefer email, WP-CLI or database access when those options are available. [WordPress password-reset guidance]

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
SaleBestseller No. 3
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
Plastic parts in K120 include 51% certified post-consumer recycled plastic*; Product carbon footprint: 4.02 kg CO2e
$12.34
SaleBestseller No. 5
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Logitech K270 Full Size Wireless Keyboard for Windows - Black
Plastic parts in K270 include 38% certified post-consumer recycled plastic; Eight hot keys: For instant access to the Internet, e-mail, music volume and more
$21.48
Best Value
Sale
Logitech K270 Full Size Wireless Keyboard for Windows - Black
  • All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
  • Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
  • Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
  • Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
  • Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
Rank #4
Redragon K521 Upgrade Rainbow LED Gaming Keyboard, 104 Keys Wired Mechanical Feeling Keyboard with Multimedia Keys, One-Touch Backlit, Anti-Ghosting, Compatible with PC, Mac, PS4/5, Xbox
  • 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
  • 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
  • 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
  • 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
  • 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
Rank #3
Sale
Logitech K120 Full Size Wired Keyboard USB Plug-and-Play Windows - Black
  • All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
  • Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
  • Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
  • Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
  • Plastic parts in K120 include 51% certified post-consumer recycled plastic*

After you regain access

  • Set a strong password that is unique to this site; WordPress advises against reusing passwords and offers generated passwords during password reset or account creation. [WordPress password best practices]
  • If the new password still fails, check that you entered the case-sensitive username and password correctly. For login problems beyond a forgotten password, WordPress also suggests checking cookies and browser cache. [WordPress login troubleshooting]

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.