Why this happens

After a successful login, WordPress sets an authentication cookie and redirects you back to wp-admin - but if your site's URL settings don't match your actual domain, a security plugin blocks the cookie, or the cookie domain is misconfigured, WordPress can't recognize that you're logged in and sends you back to the login screen in a loop.

Step-by-step fix

  1. Clear your browser cookies and try again, or use an incognito/private window.
  2. In phpMyAdmin, check the wp_options table - siteurl and home should both match.
  3. If a security plugin (like Wordfence) is installed, temporarily disable it by renaming its plugin folder.
  4. You can also try manually setting the cookie domain in wp-config.php if the issue continues.

How to prevent it happening again