If you enter your WordPress username and password correctly but the page just reloads and sends you back to the login screen instead of opening your dashboard, this is almost always caused by a mismatch between your site's saved URL and the address in your browser, stale cookies, or a plugin interfering with the login process. It is rarely a sign that your site has been hacked, and you can usually fix it yourself without ever reaching wp-admin.
Why This Happens
WordPress stores your site's web address in its database and compares it against the address in your browser every time you log in. If the two do not match exactly, for example one uses "https" and the other "http", or one has "www" and the other does not, WordPress refuses to set the login cookie and bounces you back to the login form. Corrupted cookies, a cached page, a broken .htaccess file, or a plugin blocking cookies can cause the same symptom.
1. Clear Your Browser Cookies and Cache
Start with the simplest fix. Old or corrupted cookies for your site are one of the most common causes of a login loop.
- Clear your browser's cookies and cached files for your website's domain, or try logging in from a private/incognito window.
- Try a different browser if the incognito window still loops.
If this solves it, you are done. If not, move on to checking your site's URL settings.
2. Check Your Site's URL Settings in wp-config.php
Since you cannot reach the dashboard to check Settings then General, you can check and correct the site URL directly in your site's files using your hosting control panel's File Manager (cPanel or DirectAdmin).
- Log in to your hosting control panel and open File Manager.
- Navigate to your website's root folder, usually public_html, or a subfolder if WordPress is installed there.
- Right-click wp-config.php and choose Edit (or Code Editor).
- Just above the line that says
/* That's all, stop editing! */, add these two lines, replacing the example address with your actual website address exactly as visitors type it, including "https" if your site uses SSL:
define('WP_HOME','https://www.example.com');
define('WP_SITEURL','https://www.example.com');
- Save the file and try logging in again.
Download a copy of wp-config.php to your computer before editing it, so you have something to restore if a change causes an error. Once your site loads and logs in normally, remove these two lines and set the URLs properly from Settings then General inside the dashboard instead.
3. Restore the Default .htaccess File
A corrupted .htaccess file can also interfere with login redirects.
- In File Manager, locate the .htaccess file in your site's root folder. You may need to enable Show Hidden Files first.
- Rename the existing file to .htaccess_old as a backup.
- Create a new file named .htaccess and paste in the default WordPress rules:
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
- Save the file and try logging in again.
4. Disable Plugins Manually
A security or caching plugin can sometimes block the login cookie. Since you cannot reach the plugins screen, disable them from File Manager instead.
- Navigate to wp-content/plugins.
- Rename the plugins folder to something like plugins_old. This deactivates every plugin at once without deleting any files.
- Try logging in again. If it works, rename the folder back to plugins, then rename each plugin's individual subfolder one at a time, testing after each one, until you find the plugin causing the loop.
5. Check for a Mixed HTTP/HTTPS Redirect
If your site recently moved to SSL, an old rule forcing part of the site to plain HTTP while WordPress expects HTTPS, or the reverse, can cause the exact same loop. Confirm that WP_HOME and WP_SITEURL above use the correct protocol, and that no redirect rule in your .htaccess file sends wp-login.php or wp-admin to a different protocol than the rest of the site.
If you recently reset your password and still cannot get past the login screen, confirm the issue really is a redirect loop and not your credentials by resetting your WordPress admin password.