How to Reset Your WordPress Password: 4 Methods (Dashboard, Database & FTP)

Locked Out of WordPress? 4 Fast Ways to Reset Your Password
Locked Out of WordPress? 5 Fast Ways to Reset Your Password

Keywords: "Reset WordPress Password", "WordPress Password Recovery", "Locked Out of WordPress".
 

Locked Out of WordPress? 4 Fast Ways to Reset Your Password

Few things trigger instant panic quite like typing in your administrative password, clicking Log In, and seeing the dreaded red error banner: "The password you entered for the username is incorrect."

Whether you are running a simple personal blog or a high-traffic e-commerce store, losing administrator access disrupts your workflow, halts content updates, and poses potential operational risks. The good news is that WordPress stores password credentials in a modular way — meaning if the standard login screen fails, you have several reliable backdoors to regain control.
 

When Does This Happen? Common Lockout Scenarios

Being locked out isn't always a simple case of forgotten credentials. Understanding why it happened helps choose the fastest recovery path:

  • Lost or Misconfigured Email Services: You click "Lost your password?", but the automated reset email never arrives because your web server isn't properly configured to send outgoing emails (wp_mail() failure) or the email landed in spam.
  • Security & Plugin Conflicts: A security plugin (like Wordfence or iThemes) locked your IP address after too many failed attempts, or a plugin conflict disabled the standard login page.
  • Hacked or Compromised Accounts: A malicious actor gained access and altered your admin user account credentials and recovery email.
  • Inherited Sites: Taking over a website for a client or company where the previous developer did not hand over login credentials or associated recovery emails.
  • Database Migration Errors: Moving a site to a new domain or host without properly updating or syncing user tables.

 

Quick Essentials: How WordPress Handles Passwords

Before attempting a reset, it helps to understand the underlying mechanics:
Storage Location — User credentials live in your site's database, specifically inside the wp_users table.
Encryption Type — WordPress never stores plain-text passwords. It uses salted MD5 hashing (or PHPASS) to encrypt passwords before storing them.
Database Identifier — Each account has a unique ID, a user_login (username), and a user_pass (hashed string).

Because of this structure, replacing a password directly in the database requires converting plain text into a hashed string or using built-in WordPress functions that do it automatically.

 

Step-by-Step Recovery Guides

Here are the four most common, effective ways to reset a WordPress password, ordered from the simplest method to advanced server-level overrides.

 

The Standard "Lost Your Password?"
The Standard WordPress "Lost Your Password?", WordPress login screen

Method 1: The Standard "Lost Your Password?" Link (Easiest)

If your server’s email system functions correctly, this is the quickest route.

  1. Navigate to your WordPress login screen (https://example.com/wp-login.php or https://example.com/wp-admin/).
  2. Click the Lost your password? link below the login box.
  3. Enter your administrator Username or Email Address.
  4. Click Get New Password.
  5. Check your inbox for the password reset link, follow the URL, and type your new secure password.

 

 

Reset via phpMyAdmin, Example wp_users table
Reset via phpMyAdmin, Example wp_users table

Method 2: Reset via phpMyAdmin (Most Popular Database Method)

When recovery emails fail to send, modifying the database directly via hosting tools like cPanel or Plesk is the standard industry workaround.

  1. Access phpMyAdmin: Host control panel required. Log into your hosting account control panel (cPanel, SiteTools, or Plesk) and locate the phpMyAdmin icon under the Database section.
  2. Locate Your Database & Users Table: Select your website's database from the left sidebar. Scroll through the tables and click on wp_users (Note: your database prefix might be different than wp_, e.g., wp54_users).
  3. Edit the Admin Account: Find your administrator username under the user_login column and click Edit (or the pencil icon) next to that row.
  4. Apply the MD5 Hash & New Password: Locate the user_pass row: In the Function drop-down menu, select MD5. In the Value field, delete the existing hashed string and type your desired new password in plain text.
  5. Save and Test: Scroll to the bottom of the page and click Go to save changes. You can now log into your WordPress dashboard using the new password.

 

 

Reset WordPress Password via FTP, editing functions.php file
// file: functions.php
// PHP

wp_set_password( 'YourNewPassword123!', 1 );

Navigate and edit this file /wp-content/themes/your-active-theme/functions.php.
Directly after the opening <?php tag at the very top, add this single line of code:
wp_set_password( 'YourNewPassword123!', 1 );

Method 3: Reset via FTP / File Manager (functions.php)

If you don't have database access but possess FTP credentials or access to your host's File Manager, you can force a password update via your active theme.

  1. Connect to your site using an FTP client (like FileZilla) or your host’s File Manager.
  2. Navigate to /wp-content/themes/your-active-theme/.
  3. Locate the functions.php file, download a backup copy, and open the original for editing.
  4. Directly after the opening <?php tag at the very top, add this single line of code:  wp_set_password( 'YourNewPassword123!', 1 )  
    (Replace 1 with the user ID of your admin account if it differs from the primary account).
  5. Save and upload the file back to your server.
  6. Refresh your login page https://example.com/wp-login.php. The code executes instantly and updates the password.
  7. CRITICAL STEP: Re-open functions.php, remove that line of code, and re-upload the file. Leaving this line in place will reset your password on every single page load.

 

 

Reset WordPress Password via SSH and WP-CLI
wp user update admin --user_pass="YourNewPassword123!"

#or

wp user reset-password admin --show-password

(Replace admin with your actual username).

First command will set new password for Admin user.
Second command will generate a new password for Admin user.

Method 4: Reset via WP-CLI (Best for Developers & SSH Users)

If you have SSH access to your server, the WordPress Command Line Interface (WP-CLI) offers the fastest terminal-based recovery method.

Required: SSH Access, Installed WP CLI

 

Summary

Getting locked out of WordPress is inconvenient, but it is rarely fatal to your site.

  • First line of defense: Try the default reset link via email.
  • No email arriving? Use phpMyAdmin to hash a new password using MD5, or edit functions.php temporarily via FTP.
  • Power users: Execute a single WP-CLI command over SSH.

Once access is restored, configure an SMTP plugin (such as WP Mail SMTP) so future password reset emails arrive reliably, and keep a backup of your site before making manual database edits.