WordPress Login Failed – What to Do If You Can’t Log In?

jiuyi
Administrator
285
Posts
0
Fans
Login & SecurityComments180Characters 922Views3min4sRead

Few things are as frustrating for a WordPress site owner as being unable to log into the admin dashboard. It can feel like coming home to find your keys don’t work. You panic, then get frustrated, and finally, you start looking for a solution.

If you’re here, you’re at the solution-seeking stage. The good news is that with a systematic approach, you can regain access. This guide outlines a linear, step-by-step troubleshooting process used by experienced developers. We’ll start with the simplest fixes and move to more advanced solutions.

Before You Begin: Consider a Backup
If you have a recent backup of your site from just before the login issue occurred, restoring it might be the quickest solution. Check your hosting control panel (like cPanel or a custom panel like BaoTa) or your backup plugin’s remote storage for a backup point. If you’re running a dynamic site (e.g., WooCommerce) and need to preserve recent data, proceed with the steps below after creating a fresh manual backup of your files and database via your host’s tools.


Step-by-Step Troubleshooting Guide

Follow these steps in order. Once you regain access, stop and secure your login.

1. Restore the Default Login URL

Problem: You see a message like “This has been disabled” or a 404 error at /wp-admin or /wp-login.php.

Cause: You or a security plugin changed the default login URL, and you’ve forgotten the new slug or the plugin is malfunctioning.

Solution: Temporarily disable the login URL-changing plugin via SFTP.

  1. Connect to your site via SFTP.

  2. Navigate to /wp-content/plugins/.

  3. Find the folder of the login security plugin (e.g., wps-hide-loginperfmatters).

  4. Rename the folder (e.g., add -disabled to the end).

  5. Try logging in at https://www.wptroubleshoot.com/wp-admin.

2. Reset Your Admin Password via the Database

Problem: You get an “Invalid password” error, and the “Lost your password?” email never arrives.

Cause: WordPress email is not configured correctly, or the password reset link is being blocked.

Solution: Reset the password directly in the MySQL database using phpMyAdmin.

  1. Access phpMyAdmin via your hosting control panel.

  2. Select your WordPress database.

  3. Find the wp_users table (note: your prefix may differ from wp_).

  4. Click Browse, find your admin user, and click Edit.

  5. In the user_pass field, enter a new password.

  6. From the Function dropdown next to it, select MD5.

  7. Click Go. You can now log in with the new password.

WordPress Login Failed – What to Do If You Can’t Log In?-Picture1

3. Create a New Administrator User

Problem: You can log in but lack administrator capabilities (can’t access Plugins, Themes, etc.).

Cause: Your user role was inadvertently changed, or your site was compromised.

Solution: Manually create a new admin user in the database.

  1. In phpMyAdmin, select your WordPress database.

  2. Go to the wp_users table and click Insert.

  3. Fill in the fields: user_loginuser_pass (with MD5 function), user_email, etc. Use a high, unique number for ID.

  4. Click Go. Note the assigned ID (e.g., 8).

  5. Go to the wp_usermeta table and click Insert.

  6. Add the first row: user_id = [the new ID], meta_key = wp_capabilitiesmeta_value = a:1:{s:13:"administrator";b:1;}.

  7. Add the second row: user_id = [the new ID], meta_key = wp_user_levelmeta_value = 10.

  8. Log in with the new admin credentials.

WordPress Login Failed – What to Do If You Can’t Log In?-Picture2

4. Disable Security or Login Limiter Plugins

Problem: You are locked out after too many failed attempts, or you see a security-related blocking message.

Cause: A security plugin (e.g., Wordfence, iThemes Security) has locked your IP address or session.

Solution: Temporarily disable the security plugin via SFTP.

  1. Connect via SFTP and go to /wp-content/plugins/.

  2. Locate the folder of your security plugin.

  3. Rename the folder (e.g., change wordfence to wordfence-disabled).

  4. Try to log in again. Once in, you can rename the folder back and configure the plugin’s whitelist or lockout settings.

5. Resolve the White Screen of Death (WSoD)

Problem: You see a completely blank screen when trying to access /wp-admin.

Cause: Typically a fatal PHP error caused by a plugin or theme conflict, or insufficient memory.

Solution A: Disable All Plugins

  1. Via SFTP, navigate to /wp-content/.

  2. Rename the plugins folder to plugins.disabled.

  3. Try to access /wp-admin. If successful, rename the folder back to plugins and disable plugins one-by-one from the dashboard to identify the culprit.

Solution B: Increase PHP Memory Limit

  1. Via SFTP, edit the wp-config.php file in your site’s root directory.

  2. Add this line above /* That's all, stop editing! Happy publishing. */:
    define('WP_MEMORY_LIMIT', '256M');

  3. Save and upload the file. Try logging in again.

6. Fix Database Connection Errors

Problem: You see “Error Establishing a Database Connection.”

Cause: Incorrect database credentials in wp-config.php or database server issues.

Solution:

  1. Via SFTP, edit the wp-config.php file.

  2. Verify and correct the DB_NAMEDB_USERDB_PASSWORD, and DB_HOST values with your hosting provider’s details.

  3. Save and upload the file.

  4. If the error persists, contact your hosting provider to check the database server status.

WordPress Login Failed – What to Do If You Can’t Log In?-Picture3

7. Roll Back Recent Code Changes

Problem: You see a “Parse error: syntax error” message with a file path.

Cause: A recent edit to a core file (like functions.php), plugin file, or a pasted code snippet contains a syntax error.

Solution:

  1. The error message will indicate the problematic file (e.g., /wp-content/themes/your-theme/functions.php).

  2. Via SFTP, navigate to and edit that file.

  3. Revert the most recent changes you made. If unsure, compare with a backup or a fresh copy of the theme/plugin.

  4. Save and upload the file. Your site should reload, allowing login.

Troubleshooting Flowchart

WordPress Login Failed – What to Do If You Can’t Log In?-Picture4

 
jiuyi
  • by Published onJanuary 15, 2026
  • Please be sure to keep the original link when reposting.:https://www.wptroubleshoot.com/wordpress-login-failed/

Comment