How to Reset WordPress Password When You Can't Access Your Email
**Description:**If you've lost access to your WordPress admin password and can’t use your usual email for recovery, don’t worry—there are several alternative methods to reset your password using tools provided in your Eco Hosting shared hosting account. This guide will walk you through three straightforward methods suitable for users with basic technical knowledge, using cPanel, File Manager, and phpMyAdmin.
Table of Contents
Method 1: Reset Password via phpMyAdmin
This is the most common method for shared hosting customers to reset a WordPress password without email access.
Steps:
-
Login to Your Eco Hosting cPanel
-
Navigate to the Databases section and click on phpMyAdmin.
-
In phpMyAdmin, select the database connected to your WordPress site (you can find the database name in your
wp-config.php
file). -
Click on the
wp_users
table from the left menu. -
Locate your username and click Edit.
-
Find the
user_pass
field. In the "Function" dropdown, choose MD5. -
In the "Value" field, enter your new password (e.g.,
newpassword123
). -
Click Go to save changes.
Example:
Field | Function | Value |
---|---|---|
user_pass | MD5 | newpassword123 |
You can now log in to WordPress with your new password.
Method 2: Reset Password via functions.php
File
If you prefer not to use phpMyAdmin, you can temporarily add code to your theme’s functions.php
file.
Steps:
-
Login to cPanel and open the File Manager.
-
Navigate to
public_html/wp-content/themes/your-theme/
. -
Locate and right-click on the
functions.php
file. Select Edit. -
Add the following line at the top, just after the opening
<?php
tag:wp_set_password('newpassword123', 1);
-
Replace
'newpassword123'
with your desired password. -
1
is the default user ID for the first admin. If you’re resetting another user, check their user ID in thewp_users
table.
-
-
Save changes.
-
Visit your WordPress login page and log in with the new password.
-
Important: Remove the line you just added from
functions.php
after logging in, to avoid potential security issues.
Method 3: Use WordPress CLI (if available)
Note: This may only be available on certain hosting plans. If unsure, check your cPanel for a Terminal or SSH option.
Steps:
-
Open your cPanel Terminal or connect via SSH.
-
Navigate to your WordPress directory, e.g.:
cd public_html
-
Run the following command:
wp user update [username] --user_pass=[newpassword]
Example:
wp user update admin --user_pass=newpassword123
Troubleshooting & Tips
-
**Can’t find the correct database?**Check the database name in your
wp-config.php
file (public_html/wp-config.php
):define('DB_NAME', 'your_db_name');
-
Password not updating?
-
Double-check that you selected MD5 in phpMyAdmin.
-
Make sure you edited the correct user in
wp_users
. -
Remove any added code from
functions.php
after use.
-
-
Site errors after editing files?
-
Check for syntax errors in
functions.php
(missing semicolons or parentheses). -
Restore the original file from a backup if needed.
-
Still Need Help?
If you’re unable to reset your password using these methods, please submit a support ticket and our team will assist you further.
For more WordPress and cPanel tips, visit the Eco Hosting Help Centre.