Fix WordPress Login Issues
Can’t log in to WordPress? Step-by-step fixes for wrong passwords, redirect loops, locked-out admin accounts, and wp-login.php errors.
Getting locked out of your WordPress dashboard is frustrating but usually fixable. This guide covers the most common reasons you can’t log in and how to get back in.
Forgot Your Password
The fastest fix – use WordPress’s built-in password reset.
- Go to
yourdomain.com/wp-login.php - Click “Lost your password?”
- Enter your admin email address and click Get New Password
- Check your inbox for the reset link
Not receiving the reset email? Check your spam folder. If it’s not there, your server may have email delivery issues. Use the database method below instead.
Reset Password via phpMyAdmin
If the email reset doesn’t work, change the password directly in the database:
- Log in to cPanel and open phpMyAdmin
- Select your WordPress database (check
wp-config.phpif you’re unsure which one: look forDB_NAME) - Click the wp_users table (the prefix may vary – it could be
wp_,wp2_, etc.) - Find your admin user and click Edit
- In the user_pass field:
- Change the Function dropdown to MD5
- Enter your new password in the Value field
- Click Go to save
- Log in with your new password at
yourdomain.com/wp-login.php
Login Page Redirects Back to Itself
If the login page reloads after you enter valid credentials, it’s usually a cookie issue:
Clear Browser Cookies
- Clear your browser’s cookies and cache for your domain
- Try logging in again
- Test in an incognito/private window
Check WordPress URLs
If the site URL is misconfigured, cookies won’t work:
- Open wp-config.php via File Manager or SSH
- Add these lines above the
/* That's all, stop editing! */comment:
define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');
- Save and try logging in again
- Once you’re in, go to Settings > General and make sure both URLs are correct, then remove the lines from
wp-config.php
Force SSL on Login
If your site uses HTTPS but the login page loads on HTTP, add this to wp-config.php:
define('FORCE_SSL_ADMIN', true);
The Login Page Returns a 404 or White Screen
This usually means .htaccess is broken or corrupted:
- Connect via SSH or File Manager
- Rename
.htaccessto.htaccess_backup:mv .htaccess .htaccess_backup - Create a fresh
.htaccesswith default WordPress rules:cat > .htaccess << 'EOF' # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress EOF - Try accessing
wp-login.phpagain - If it works, go to Settings > Permalinks and click Save to regenerate the
.htaccessproperly
“Too Many Redirects” Error
This is a redirect loop. Fix it by:
- Clearing your browser cookies for the domain
- Checking for conflicting
.htaccessredirect rules - Adding this to
wp-config.phptemporarily:
define('WP_HOME', 'https://yourdomain.com');
define('WP_SITEURL', 'https://yourdomain.com');
- If you’re behind Cloudflare, make sure SSL mode is set to Full (Strict), not Flexible
Locked Out by a Security Plugin
If a security plugin (Wordfence, Sucuri, iThemes Security) locked you out:
- Connect via SSH or File Manager
- Navigate to
wp-content/plugins/ - Rename the security plugin’s folder:
mv wp-content/plugins/wordfence wp-content/plugins/wordfence_disabled - Log in to WordPress
- Rename the folder back and reconfigure the plugin’s settings
“Cookies Are Blocked” Error
WordPress shows this when it can’t set login cookies:
- Make sure cookies are enabled in your browser
- Check that your domain isn’t blocked by browser extensions (ad blockers, privacy extensions)
- Verify that
wp-config.phphas the correctCOOKIE_DOMAIN:
define('COOKIE_DOMAIN', 'yourdomain.com');
Last Resort: Create a New Admin via MySQL
If nothing else works, create a brand new admin account directly in the database:
- Open phpMyAdmin in cPanel
- Click the SQL tab
- Run this query (replace the placeholder values):
INSERT INTO wp_users (user_login, user_pass, user_nicename, user_email, user_registered, user_status)
VALUES ('newadmin', MD5('YourNewPassword123!'), 'newadmin', 'you@email.com', NOW(), '0');
INSERT INTO wp_usermeta (user_id, meta_key, meta_value)
VALUES (LAST_INSERT_ID(), 'wp_capabilities', 'a:1:{s:13:"administrator";s:1:"1";}');
INSERT INTO wp_usermeta (user_id, meta_key, meta_value)
VALUES (LAST_INSERT_ID(), 'wp_user_level', '10');
- Log in with
newadmin/YourNewPassword123! - Change the password immediately after logging in
Related Articles
- Fix the WordPress Redirect Loop
- Fix the WordPress White Screen of Death
- Securing Your WordPress Site
- Contact GoZen Support - if you still cannot access your WordPress admin
Last updated 19 Apr 2026, 23:46 +0300.