WordPress login issues: common causes and how to fix them
Key takeaways
- Most WordPress login issues trace back to wrong credentials, missing reset emails, blocked cookies, a plugin conflict, a wrong WP_HOME or WP_SITEURL value, an exhausted PHP memory limit, bad file permissions or a security plugin lockout.
- A forgotten WordPress password can be reset from the Lost your password link, with WP-CLI or through phpMyAdmin, and WordPress rehashes an MD5 database reset with bcrypt at the next login.
- A login page that keeps refreshing points to cookies, so clearing them in Google Chrome, Firefox or Safari and testing a private window comes before any server change.
- Renaming the plugins folder over SFTP, or running wp plugin deactivate in WP-CLI, rules out a plugin conflict without the WordPress dashboard.
- Redirect loops after an HTTPS switch or a migration are fixed by matching the siteurl and home values in the wp_options table, or by setting WP_HOME and WP_SITEURL in wp-config.php.
- The WordPress Advanced Administration Handbook and the NCSC both recommend two-factor authentication and a password manager for every administrator account.
Most WordPress login issues come from one of eight causes, which are wrong credentials, password reset emails that never arrive, blocked or stale browser cookies, a plugin or theme conflict, a wrong WP_HOME or WP_SITEURL value, an exhausted PHP memory limit, incorrect file permissions or a lockout by a security plugin such as Wordfence or Kadence Security. Work through the fixes in that order, from the Lost your password link in WordPress to the siteurl and home rows in the MySQL database. For persistent problems, Priority Pixels provides WordPress support for businesses that identifies and resolves the root cause quickly.
Losing access to the WordPress dashboard halts content updates, WooCommerce orders and design changes. A recurring lockout points to a hosting or security plugin issue, such as a Wordfence IP block, rather than a bug in WordPress core. Most login problems in WordPress stem from a handful of common issues that have straightforward solutions.
Why won’t WordPress accept your login details?
WordPress rejects a login when the username or password doesn’t match the record in the wp_users table of the MySQL database, and the fastest fix is the Lost your password link. Passwords in WordPress are case-sensitive, so Caps Lock and recent credential changes catch people off guard. Hit “Lost your password?” on the wp-login.php screen and WordPress sends a reset email to your registered address.
No email after a few minutes means checking your Gmail or Outlook spam folder first. If that comes up empty, your website probably has SMTP or email delivery issues that need fixing. The official WordPress guide to resetting your password lists the other routes, including MySQL on the command line, phpMyAdmin, FTP and WP-CLI.
- phpMyAdmin
- A browser-based tool for managing MySQL and MariaDB databases, included in hosting control panels such as cPanel and Plesk.
- WP-CLI
- The official command-line interface for WordPress, run over SSH to manage users, plugins and settings without the dashboard.
- MD5
- An old hashing function that MySQL calculates with its MD5() function. WordPress accepts an MD5 password hash, then replaces it with a stronger hash at the next login.
- bcrypt
- The password hashing algorithm WordPress uses from version 6.8 onwards, in place of the older phpass portable hashes.
- SFTP
- Secure File Transfer Protocol, the encrypted way to reach WordPress files on the server with a client such as FileZilla or WinSCP.
Access to your hosting control panel, such as cPanel or Plesk, opens up direct database password resets through phpMyAdmin. Go to your WordPress database (its name is the DB_NAME value in wp-config.php), open the wp_users table and locate your username row. Update the user_pass field with your new password, choose MD5 from the Function dropdown in phpMyAdmin and save your changes. WordPress needs that MD5 hash for passwords updated through the database.
-- Reset WordPress password via SQL
UPDATE wp_users
SET user_pass = MD5('your-new-password')
WHERE user_login = 'your-username';
Test your login with the new password after running that query in phpMyAdmin. Then change your password again under Users, Profile in the dashboard, because WordPress replaces the weak MD5 hash with a stronger one when you next log in. Since WordPress 6.8 switched password hashing to bcrypt, that rehash uses bcrypt, and the Make WordPress Core team confirmed MD5 database resets remain supported.
SSH access to the server gives you a faster route through WP-CLI that never touches the database by hand. The wp user update command in WP-CLI, with the --user_pass flag, sets a new password for any account, as the WP-CLI user update documentation shows. The new password is hashed with bcrypt straight away in WordPress 6.8 and later, so there’s no second change to make afterwards.
Why does the WordPress login page keep refreshing?
A WordPress login page that keeps refreshing, or sends you back to wp-login.php after you enter the right password, points to a cookie problem in Chrome, Safari or whichever browser you use. WordPress sets a test cookie before you log in and an authentication cookie afterwards. The WordPress cookies documentation explains that a failed write shows “Cookies are blocked or not supported by your browser.” Block those cookies or let cached data interfere and you’ll get stuck in an endless loop with no error message at all.
Clear your browser cache and cookies completely first. The Google Chrome Help page on clearing cookies walks through the Privacy and security settings in Chrome, and Firefox, Safari and Microsoft Edge keep the same option under their privacy or history settings. Close the browser entirely after clearing everything, then restart it before you try logging in again.
Open a private window (Incognito in Chrome, InPrivate in Edge) and try logging in there instead if you’re still stuck after clearing the cache. Test a completely different browser too, such as Firefox if you normally use Chrome. This cuts out browser extensions and cached data as potential causes, which tells you if one specific browser is causing the problem.
| Symptom | Likely Cause | Quick Fix |
|---|---|---|
| Login page keeps reloading | Cookies blocked or expired | Clear cookies and cache |
| Redirected back to login after entering credentials | Cookie path mismatch | Check wp-config.php cookie settings |
| Login works in incognito but not normal mode | Browser extension conflict | Disable extensions and retry |
| “Cookies are blocked” error message | Browser privacy settings | Allow cookies for your domain |
| WordPress keeps logging you out | www and non-www addresses mixed, or a cached login page | Match the WordPress Address and Site Address, then purge the page cache |
If your browser keeps spinning you back to the login screen, open your wp-config.php file and manually set the cookie path. Add the following lines, replacing yourdomain.co.uk with your actual domain, then save and try logging in again.
define('COOKIE_DOMAIN', 'yourdomain.co.uk');
define('COOKIEPATH', '/');
define('SITECOOKIEPATH', '/');
A caching plugin such as WP Rocket or W3 Total Cache, or a CDN like Cloudflare, can also serve a stored copy of wp-login.php that carries an old cookie. The WordPress cookies documentation recommends deleting your cookies and clearing the caching plugin’s cache when the error appears after a website move. Exclude wp-login.php and wp-admin from every cache layer, including the caching plugin, Cloudflare and any server-level cache such as Varnish, so the problem doesn’t return.
Can a plugin or theme conflict block the WordPress login?
Yes, a plugin or theme conflict is one of the most common reasons a WordPress login stops working. Security plugins are a frequent cause because they change login URLs, add CAPTCHA challenges or set IP restrictions that lock out administrators. Sometimes it’s custom code, two plugins that clash or a recent update that has broken something.
Suspect a plugin? Deactivate every one through an SFTP client such as FileZilla, or the file manager in cPanel, without touching the admin area. Go to /wp-content/plugins/ and rename that folder to plugins-disabled or anything else. WordPress deactivates every plugin instantly when it can’t find the folder. If the login works now, rename it back to plugins and reactivate them individually until you spot the culprit.
- Deactivate all plugins by renaming the plugins folder over SFTP, or by running wp plugin deactivate –all in WP-CLI.
- Test the login at wp-login.php in a private browser window, such as Incognito in Chrome, to rule out cookies.
- Reactivate plugins one at a time, starting with security plugins like Wordfence and caching plugins like WP Rocket, until the login breaks again.
- Switch to a default theme such as Twenty Twenty-Five if every plugin is off and the login still fails.
The same job takes one command in WP-CLI, and the wp plugin deactivate documentation covers switching off one plugin by name or all of them at once. When a plugin throws a fatal error, WordPress 5.2 and later also email the administrator a link to recovery mode, as the Make WordPress Core announcement of recovery mode explains, so check the admin inbox before reaching for SFTP.
Default themes like Twenty Twenty-Five fix login problems that plugin deactivation doesn’t. Rename your active theme’s folder in /wp-content/themes/ and WordPress drops back to an installed default theme automatically.
Most conflict-related login problems disappear when you keep your plugins and themes updated regularly. Our WordPress maintenance and security service tests every update in a staging environment first, with compatibility checks and a rollback, so your live website won’t break.
Wp-config.php misconfiguration
A misconfigured wp-config.php file breaks the WordPress login because it holds the database connection, security keys and site URLs. Any mistake in it sends your login into complete failure or bizarre redirect loops.
- WP_SITEURL and WP_HOME. If these are set incorrectly (for example, pointing to HTTP instead of HTTPS or including a trailing slash inconsistently), WordPress enters a redirect loop during login.
- Database credentials. If your MySQL or MariaDB username, password or hostname has changed and
wp-config.phphasn’t been updated, WordPress can’t verify your login credentials against the database, and you’ll see an “Error establishing a database connection” message. - Security keys and salts. If AUTH_KEY, SECURE_AUTH_KEY, LOGGED_IN_KEY, NONCE_KEY or their matching salts have been corrupted or removed, existing login sessions become invalid. You can generate fresh keys using the WordPress secret key generator and paste them into your wp-config.php file.
The official WordPress documentation on wp-config.php makes it clear that getting this file wrong locks you out completely. It also lists the constants the file accepts, including WP_HOME and WP_SITEURL, so check the exact spelling there before you edit anything.
Back up wp-config.php over SFTP before you change a single line. Edit it in a plain text editor such as Notepad++ or Visual Studio Code, never a word processor, because invisible characters break PHP syntax.
Back up the database with phpMyAdmin or WP-CLI as well, then upload the edited file and test the login straight away. Keep the backup copy until the website is working, so you can restore the original over SFTP in seconds if the change makes things worse.
How do you fix a WordPress login redirect loop?
You fix a WordPress login redirect loop by making the WordPress Address and Site Address match the real URL, including HTTPS, in either wp-config.php or the database. You click login, the page loads and bounces you straight back, or Chrome throws up an ERR_TOO_MANY_REDIRECTS error and gives up.
Switching from HTTP to HTTPS breaks things, and website migrations change the WordPress Address and Site Address fields in Settings, General. There are two options when you can’t reach the WordPress dashboard to correct them.
Drop hard-coded URL values into wp-config.php or head straight for the database. Open phpMyAdmin and locate your wp_options table, then track down the rows where option_name displays siteurl and home. Update both option_value entries with your correct site URL and make sure you include the protocol (HTTPS) but remove any trailing slashes.
define('WP_HOME', 'https://yourdomain.co.uk');
define('WP_SITEURL', 'https://yourdomain.co.uk');
WordPress behind a reverse proxy, a load balancer or a CDN such as Cloudflare won’t work correctly without some tweaks. You need to add a server variable check to your wp-config.php file so WordPress detects HTTPS connections that terminate at the proxy level. This prevents redirect loops when WordPress wrongly assumes the connection isn’t secure.
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') {
$_SERVER['HTTPS'] = 'on';
}
Most managed WordPress hosting providers handle this configuration automatically though. On a self-managed server running Apache or Nginx, you’ll need to add the snippet above yourself.
Is a PHP memory limit causing a blank login screen?
An exhausted PHP memory limit causes blank screens and fatal errors during login attempts. WordPress runs out of PHP memory halfway through the process and crashes, which leaves you facing the White Screen of Death or an “Allowed memory size exhausted” message rather than your admin dashboard. Add this line to your wp-config.php file above “That’s all, stop editing!” to increase the memory limit.
define('WP_MEMORY_LIMIT', '256M');
WordPress asks PHP for more memory at runtime to reach WP_MEMORY_LIMIT, and the WordPress Hosting Handbook notes that whether the request succeeds is up to the server. Complex websites with WooCommerce and resource-heavy plugins need more headroom than a simple blog. Some hosts won’t let you change memory settings yourself, which means asking them to raise the PHP memory_limit in php.ini at server level.
If you’re consistently hitting memory limits, investigate which plugins are consuming the most resources with a tool such as Query Monitor. Deactivating plugins one by one while monitoring memory usage helps you identify the biggest offenders and decide whether they’re worth keeping.
Turn on WP_DEBUG and WP_DEBUG_LOG to see which plugin or theme file ran out of memory. The WordPress debugging documentation explains how these constants write errors to /wp-content/debug.log, and the last fatal error in that file names the code responsible.
File permission problems
Wrong file permissions block the WordPress login because WordPress can’t read or write the files it needs for authentication. Shared hosting and website migrations are the most common causes, because permission settings get changed during the transfer process.
Check and fix these through SFTP or SSH access. The WordPress file permissions documentation sets out the values below, and these SSH commands will sort out permissions across your entire WordPress setup.
| Item | Permission | What it allows |
|---|---|---|
| Directories | 755 | Owner can read, write and execute. Group and others can read and execute. |
| Files | 644 | Owner can read and write. Group and others can read only. |
| wp-config.php | 440 or 400 | Restricted to owner read-only for security. |
find /path/to/wordpress -type d -exec chmod 755 {} +
find /path/to/wordpress -type f -exec chmod 644 {} +
chmod 400 /path/to/wordpress/wp-config.php
Setting permissions to 777 on directories creates serious security holes, and the WordPress documentation says no directory should ever be given 777, even upload directories. Stick with the minimal 755 and 644 permissions that let your website work properly.
Why is the WordPress password reset email not arriving?
WordPress password reset emails fail to arrive because many hosting providers restrict or block the PHP mail() function that WordPress relies on by default. Check your email settings when the “Lost your password?” link stops working and WordPress won’t send reset emails.
SMTP email delivery solves this problem. You’re using authenticated email servers instead of the unreliable PHP mail function, and free plugins such as WP Mail SMTP connect WordPress to Microsoft 365, Google Workspace or a transactional service once you’ve got your SMTP server details ready. Set up SMTP properly and password resets reach the inbox every time.
Domain authentication in DNS matters as much as the plugin. The Gmail email sender guidelines ask every sender to set up SPF or DKIM, and bulk senders to add DMARC as well, so publish those DNS records for the domain your WordPress emails come from.
What should you do if a security plugin locks you out?
If a security plugin locks you out, rename its folder over SFTP to deactivate it, log in, then add your IP address to its allowlist. Brute-force protection from security plugins like Wordfence, Kadence Security (formerly iThemes Security) and Sucuri will lock you out after failed login attempts. Could be you’ve mistyped your password too many times or someone’s trying to break in, but either way you’re stuck on the wrong side of the door now.
Your office IP got blocked if switching to mobile data fixes the login issue straight away. Getting back in means you’ll need SFTP access or your hosting file manager. Go to /wp-content/plugins/ and find the security plugin’s folder, then rename it to deactivate the plugin and clear the IP block. Once you’ve logged in normally, reactivate the plugin and allowlist your IP so this won’t happen again.
Brute-force attacks keep hitting WordPress websites, and two-factor authentication protects the login better than login attempt limits. The WordPress guidance on brute-force attacks recommends 2FA for every administrator and notes that WordPress core doesn’t include it, so a plugin such as Two Factor adds it. Real users won’t get accidentally locked out, and any good WordPress development setup includes proper security hardening from day one.
How can you prevent WordPress login issues?
You prevent WordPress login issues with backups, tested updates, strong passwords, working SMTP, monitoring and a secure record of your access details. Fix login problems before they happen and you’ll save yourself hours of trouble. Most issues don’t start when proper WordPress maintenance is running, and downtime stays short when something does break.
- Keep regular backups. Automated daily backups with a plugin such as UpdraftPlus or your host’s backup system mean you can restore your website quickly if a login issue turns out to be part of a larger problem.
- Update plugins and themes carefully. Test updates on a staging environment before applying them to your live website, which catches conflicts before they lock you out.
- Use strong, unique passwords. A password manager such as 1Password or Bitwarden removes the risk of forgotten credentials and makes it easy to use complex passwords.
- Configure SMTP early. Setting up authenticated email delivery when you first build your website means password resets work when you need them.
- Monitor your website. Uptime monitoring tools such as UptimeRobot alert you immediately if your login page becomes inaccessible, giving you time to respond before the problem escalates.
- Document your access details. Keep a secure record of your hosting credentials, SFTP details and database access information so you can troubleshoot without relying on the WordPress dashboard.
The National Cyber Security Centre gives the same advice for every account. Its guidance on password managers and on turning on 2-step verification applies to WordPress administrator accounts as much as to email.
Know what you’re doing and most WordPress login issues clear up in minutes. Work through each possibility starting with the obvious before you jump into complex fixes. Professional WordPress support becomes worth every penny when login problems keep returning or you’re dealing with issues that standard troubleshooting can’t touch.
FAQs
Why does the WordPress login show a blank white screen?
A blank white screen or an “Allowed memory size exhausted” message during login usually means WordPress ran out of PHP memory part way through. Adding define(‘WP_MEMORY_LIMIT’, ‘256M’); to wp-config.php raises the limit, although some hosts must raise memory_limit in php.ini themselves. Turning on WP_DEBUG and WP_DEBUG_LOG writes errors to debug.log, and the last fatal error names the code responsible.
What file permissions should a WordPress website use?
The WordPress file permissions documentation sets directories to 755, files to 644 and wp-config.php to 440 or 400, so only the owner can read it. Wrong permissions often follow shared hosting changes or a website migration and stop WordPress reading the files it needs to log you in. No directory should ever be set to 777, even upload directories, because it creates serious security holes.
Does WordPress include two-factor authentication?
No. WordPress core does not include two-factor authentication, so a plugin such as Two Factor adds it. The WordPress guidance on brute-force attacks recommends 2FA for every administrator, because it protects the login better than limits on login attempts and real users will not get locked out by mistake. The National Cyber Security Centre gives the same advice, alongside using a password manager.
Why does WordPress keep logging me out?
WordPress logs you out when its authentication cookie is lost or rejected, for example because the WordPress Address and Site Address mix www and non-www versions of the domain. A page cache that stores wp-admin or wp-login.php, or new security keys in wp-config.php, also ends existing sessions. Match both addresses under Settings, General, exclude the login and admin pages from caching and clear your browser cookies.