How to Recover a Locked WordPress Admin Account

Getting locked out of your WordPress admin area can be stressful, but there are several reliable ways to recover access without losing any of your site data. Here are the most effective methods available on dotCanada hosting.

Method 1: Reset Password via phpMyAdmin

  1. Log in to cPanel and open phpMyAdmin
  2. Select your WordPress database from the left panel
  3. Click on the wp_users table
  4. Find your admin user and click Edit
  5. In the user_pass field, select MD5 from the function dropdown and enter a new password
  6. Click Go to save

You can now log in with your new password.

Method 2: Reset Password via WP-CLI

If you have SSH access, WP-CLI makes this quick:

  • wp user update USERNAME --user_pass=newpassword

Method 3: Add an Emergency Admin via wp-config.php

As a last resort, you can temporarily add an admin user by placing a code snippet in wp-config.php. Add the following before the /* That's all */ line:

  • define('EMERGENCY_ADMIN_USER', 'tempadmin');
  • define('EMERGENCY_ADMIN_PASS', 'yourpassword');

Note: This method requires a plugin or mu-plugin to act on those constants - the simpler phpMyAdmin method is preferred. If you're unsure, just contact our support team and we'll reset your access safely.

100% Satisfaction Guarantee

We're so confident you'll love dotCanada that we offer a 30-day money-back guarantee. Not satisfied? Get a full refund, no questions asked.

Ready to Get Started?

Join thousands of Canadian website owners who trust dotCanada for reliable, fast web hosting.

Get Started Today