Recover Lost Admin Access: Reset Passwords via phpMyAdmin or WP-CLI

Recover Lost Admin Access: Reset Passwords via phpMyAdmin or WP-CLI


There are few moments more heart-stopping for a website owner than realizing you’ve been locked out of your WordPress admin dashboard. Whether you’ve forgotten your password, a plugin conflict has disabled your login form, or a rogue script has changed your credentials, the feeling of being powerless over your own website can be terrifying. While the standard password reset email is often the first solution, what happens when that fails? In these critical moments, you need a more direct approach to regain control. This guide will provide two quick, practical, and highly effective methods to reset your WordPress admin password directly through the database using phpMyAdmin or the command line with WP-CLI, getting you back in the driver’s seat. These are the kinds of advanced solutions you'll need when you are unable to perform a simple fix, like the ones in our guide on How to Troubleshoot a 403 Forbidden Error.

Method 1: Reset Password via phpMyAdmin

phpMyAdmin is a web-based tool that allows you to manage your website's database. This is a common tool provided by most hosting providers. This method is a great solution when you are locked out of your website and the standard email reset isn't working. Before you begin, always backup your database.

  1. Log in to cPanel or Your Hosting Dashboard: Find and click on the "phpMyAdmin" icon.
  2. Select Your WordPress Database: In the left-hand menu, click on the name of your WordPress database. If you have multiple databases, you can find the correct one by checking your wp-config.php file.
  3. Find the `wp_users` Table: Look for the table with the suffix _users (e.g., wp_users). Click on it.
  4. Find Your User Account: Find your admin user in the list and click the "Edit" button next to it.
  5. Reset the Password:
    • In the user_pass field, find the "Function" dropdown and select MD5.
    • In the "Value" field, enter your new password in plain text.

    Note: MD5 is an older hashing method, but WordPress will automatically re-hash it to a more secure format the moment you log in with your new password. This is a crucial step to avoid security issues, a topic we cover in our guide on how to secure your website against basic threats.

  6. Save the Changes: Click the "Go" button at the bottom of the page to save your changes. You should now be able to log in to your WordPress dashboard with your new password.

Method 2: Reset Password via WP-CLI

For more technically inclined users, WP-CLI (WordPress Command Line Interface) is a powerful tool that allows you to manage your WordPress installation without a web browser. This method is incredibly fast and efficient. You will need SSH access to your server for this to work. You'll need to know your SSH credentials, which are usually in your hosting dashboard.

  1. Connect to Your Server via SSH: Use a program like PuTTY (Windows) or Terminal (Mac/Linux) to connect to your server.
  2. Navigate to Your WordPress Installation: Use the cd command to navigate to your website's root directory (e.g., cd public_html/yourwebsite.com).
  3. Reset the Password: Run the following command, replacing 'your_username' with your actual username and 'your_new_password' with your new password:
    wp user update your_username --user_pass='your_new_password'
  4. Confirm the Change: The command will provide a confirmation message. You should now be able to log in to your WordPress dashboard.

When to Call the Experts

While these methods are powerful, they require direct access to your server and a degree of technical comfort. If you are not comfortable using phpMyAdmin or the command line, or if you suspect your website has been hacked, you should not attempt these fixes on your own. A hacked website often has more than just a changed password; there could be malicious code or a backdoor script that needs to be removed. In these cases, a professional can not only reset your password but also perform a full security audit, which is a key part of our guide on how to protect against hacks and recover from breaches. This is one of the clearest 5 signs that you need professional help to fix your website, as an incorrect fix can have disastrous results.

If you’re still having trouble, don’t worry! WebCare SG is here to help. Contact us today for fast and reliable website fixes.


Related WebCare Solutions

Is Your Website Getting Lost in the Crowd? Fixing Poor SEO Optimization for Better Visibility!

Poor SEO optimization is a common issue many website owners face, but the good news is that it can be fixed.

Local SEO for Singapore: How to Get Your Business on the Map

A practical guide for Singaporean businesses to master local SEO, covering Google Business Profile optimization, local directory listings, and strategies for gathering impactful customer reviews.

Optimize Page Titles, Meta Descriptions, and Schema Markup

Learn how to write effective page titles and meta descriptions, implement JSON-LD schema markup, and validate your code to improve your website's search engine visibility.

Ready to get started?

Focus on your business while we fix your website. Contact WebCareSG today for fast, reliable solutions!

Whatsapp us on

+65 9070 0715