Skip to main content

WP 301 Redirects

The fastest fix for a locked WordPress admin account is usually WP-CLI, but phpMyAdmin is the fallback when SSH is not available. WordPress still powers a large share of the web, listed at over 43% of all websites tracked by W3Techs [source: W3Techs], so password recovery through the database is a common support task, not an edge case. A site owner should pick the method based on access: phpMyAdmin for hosting panel access, and WP-CLI for server shell access.

TLDR: phpMyAdmin works well when an administrator can open the hosting control panel but cannot log in to WordPress. WP-CLI is cleaner and faster when SSH access exists, often taking under 60 seconds with one command. For example, an agency managing 40 WordPress sites may save 3 to 5 minutes per recovery by using WP-CLI instead of clicking through database tables. phpMyAdmin is more visual, but one wrong database edit can waste a lot of time.

When phpMyAdmin makes sense

phpMyAdmin is best for emergency recovery on shared hosting. The administrator does not need the old WordPress password. They only need database access through the hosting account.

The tradeoff is risk. phpMyAdmin exposes raw database tables. It drives many admins crazy that one site may have several old databases, similar table names, and prefixes like wp_, wpx7_, or site3_. Picking the wrong one means the password change does nothing.

How to change a WordPress password using phpMyAdmin

  1. Find the correct database name. The administrator should open the site files and check wp-config.php. The value beside DB_NAME shows the right database.
  2. Open phpMyAdmin. This is usually inside cPanel, Plesk, or another hosting control panel.
  3. Select the WordPress database. The database name must match DB_NAME.
  4. Open the users table. It is often named wp_users, though the prefix may differ.
  5. Edit the admin user row. The login name appears in the user_login column.
  6. Change the user_pass field. The administrator enters a new password and selects MD5 from the function dropdown, if available.
  7. Save the row. After login, WordPress will replace that temporary MD5 value with its current password hash format.

This method sounds old-fashioned because MD5 is not secure for stored passwords. The only reason it remains useful here is compatibility. WordPress can accept the temporary MD5 value during login, then rehash the password. The administrator should log in once right away and then update the password again from the WordPress profile screen if extra caution is needed.

When WP-CLI is the better choice

WP-CLI is better for developers, agencies, and site owners with SSH access. It avoids manual database editing. It also reduces the chance of touching the wrong field.

The basic command is simple:

wp user update admin --user_pass='NewStrongPasswordHere'

If the WordPress files are in a different directory, the command can include a path:

wp user update admin --user_pass='NewStrongPasswordHere' --path=/home/account/public_html

The administrator can also target a user by ID:

wp user update 1 --user_pass='NewStrongPasswordHere'

That is useful when usernames are unclear. A quick list command helps:

wp user list

The catch is that WP-CLI is not always installed. Some budget hosts block SSH or provide a restricted shell. In those cases, phpMyAdmin becomes the practical option, even if it feels clunky.

phpMyAdmin vs WP-CLI: which is safer?

FactorphpMyAdminWP-CLI
Access neededHosting panel and database accessSSH access and WP-CLI
SpeedUsually 3 to 10 minutesOften under 1 minute
Error riskHigher, due to manual table editsLower, if the command is correct
Beginner friendlyMore visual, but easy to misuseLess visual, but cleaner
Best use caseShared hosting recoveryDeveloper or agency workflow

For safety, WP-CLI wins when available. It uses WordPress itself to update the user, so the result is cleaner. phpMyAdmin is still reliable, but only if the administrator confirms the database, table prefix, and user row before saving anything.

Security steps after recovery

Password recovery should not end after the login works. A locked-out admin account can be a simple mistake, but it can also signal a compromise.

  • Use a unique password with at least 16 characters.
  • Remove unknown admin users from the WordPress users screen.
  • Enable two-factor authentication for administrator accounts.
  • Check recent plugin and theme changes for suspicious edits.
  • Rotate hosting, FTP, and database passwords if a breach is suspected.
  • Back up the database before making direct changes next time.

Where each method fits best

A solo site owner on shared hosting will often use phpMyAdmin because the hosting panel is the only access point. A developer with SSH should use WP-CLI almost every time. An agency may standardize on WP-CLI for speed, then keep phpMyAdmin as the fallback plan.

The practical rule is simple: use WP-CLI when shell access exists; use phpMyAdmin when database access is all that remains. Both methods can recover the account. WP-CLI is cleaner. phpMyAdmin is more universal.

FAQ

Can phpMyAdmin reset a WordPress admin password without email access?

Yes. phpMyAdmin changes the password directly in the database, so email access is not required.

Is using MD5 in phpMyAdmin safe?

It is acceptable as a temporary recovery step only. WordPress should rehash the password after a successful login. The administrator should then set a fresh password inside WordPress.

Does WP-CLI require the old password?

No. A user with proper server access can replace the password with the wp user update command.

What if the users table is not named wp_users?

The site may use a custom table prefix. The administrator should check wp-config.php for the value of $table_prefix.

Which method is better for nontechnical users?

phpMyAdmin may feel easier because it is visual, but it is also easier to damage data. If support staff or a developer is available, WP-CLI is usually the better route.