This guide explains why this happens, how to reset WordPress login credentials safely, and how to verify or repair user data directly from the server or database.
Common Login Failure Symptoms
Correct username/password not accepted
Login page refreshes without error
Redirect loop between
/wp-login.phpand/wp-admin“Cookies are blocked or not supported” error
Password reset emails not arriving
Admin user exists but cannot log in
Step 1: Check Basic Login Issues First
Before deeper fixes, verify these basics:
Caps Lock is off
Browser cookies are enabled
Clear browser cache
Try an incognito/private window
Confirm site URL is correct (
httpvshttps,wwwvs non-www)
If the issue persists, continue below.
Step 2: Enable WordPress Debug Mode
Edit wp-config.php:
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true); define('WP_DEBUG_DISPLAY', true);Reload the login page and attempt to log in again.
Look for errors related to:
Sessions
Cookies
Database
Authentication functions
Step 3: Reset WordPress Password (Multiple Methods)
Reset Password via WordPress (If Email Works)
Click “Lost your password?” on the login page.
If emails are not delivered, your VPS may lack SMTP configuration.
Reset Password via phpMyAdmin (Most Reliable)
Open
phpMyAdminSelect your WordPress database
Open the
wp_userstableFind your admin username
Edit the
user_passfieldChoose MD5 as the function
Enter a new password
Save changes
WordPress will rehash the password automatically after the first login.
Reset Password via SQL Command
Run this query (replace values):
UPDATE wp_users
SET user_pass = MD5('NewStrongPassword')
WHERE user_login = 'admin';
Reset Password via WP-CLI (Recommended)
wp user list
wp user update admin --user_pass="NewStrongPassword"
Verify the Admin User Exists and Has Correct Role
Sometimes the admin user exists but has no permissions.
Check User Role
In the database table:
wp_usermeta
Look for:
wp_capabilities
You might need to correct the value should include:
a:1:{s:13:"administrator";b:1;}Fix Missing Admin Role (SQL)
UPDATE wp_usermeta
SET meta_value = 'a:1:{s:13:"administrator";b:1;}'
WHERE user_id = 1
AND meta_key = 'wp_capabilities';
Check Security Modules & Firewall Rules
ModSecurity may block login POST requests
Fail2Ban may block your IP
Cloudflare may challenge admin requests
Whitelist:
/wp-login.php/wp-admin/
