Skip to main content

How to Reset WordPress Admin Login Details and Fix Login Issues (VPS Guide)

A common WordPress issue—especially on VPS-hosted sites—is when the admin login page loads correctly, but valid credentials are rejected, the page refreshes endlessly, or you’re redirected back to the login screen.

Updated over 2 weeks ago

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.php and /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 (http vs https, www vs 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)

  1. Open phpMyAdmin

  2. Select your WordPress database

  3. Open the wp_users table

  4. Find your admin username

  5. Edit the user_pass field

  6. Choose MD5 as the function

  7. Enter a new password

  8. 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/

Did this answer your question?