How to Set Up a WordPress Staging Site and Push Changes Live Safely
A staging site lets you test updates on a copy before customers see them. Learn how to create one, lock it down…
You type the right password and WordPress sends you back to the login page. The cause is usually cookies, address settings, caching or a plugin.
A WordPress login redirect loop is the moment you enter the correct username and password, the page reloads, and you are on the login screen again, sometimes with a URL that keeps growing. WordPress is not rejecting your password. It is failing to keep you logged in, because the login cookie is not accepted, the addresses it uses do not agree, or a cache or plugin is interfering. This guide tests those causes in order, starting with the cheapest.
First try a private window with cookies allowed, to rule out your browser. Then check that the WordPress Address and Site Address are identical, including https and www. If the login screen mentions cookies or unexpected output, look for stray characters in PHP files such as wp-config.php. Make sure wp-login.php and /wp-admin/ are not cached, and finally test with all plugins and a default theme. Keep a backup and change one thing at a time.
How this guide was prepared: it is research-based. We read the WordPress login code and the WordPress documentation listed under Sources, checked on October 23, 2026. We did not reproduce a loop on a live host, and the cause on your site may be a combination of the points below.
When you submit the login form, WordPress checks your password and sets authentication cookies in your browser; later requests to the admin area use those cookies to know who you are. WordPress also sets a test cookie before login. Its login code shows two related messages: “Cookies are blocked or not supported by your browser. You must enable cookies to use WordPress.” when the test cookie is missing, and “Cookies are blocked due to unexpected output.” when something printed output before the cookies could be sent. If neither message appears but you still loop, the cookie may be set for one address (for example without www) and then sent to another, or a cache may be answering the request instead of WordPress.

| What you see | Likely cause | Start with |
|---|---|---|
| Works in another browser or device | Old cookies or a browser extension in the first browser | Step 1 |
| Loop started after enabling HTTPS or adding or removing www | Address settings or redirects disagree | Step 2 |
| Message about cookies or unexpected output | Cookies blocked, or stray output before headers | Steps 1 and 3 |
| Login worked until you switched on caching | A cache is serving the login or admin request | Step 4 |
| Started after a plugin or theme update | A security, login or caching plugin conflict | Step 5 |
Open the login page in a private window with cookies allowed, or in a different browser or device. If it works there, clear the cookies and cache for your site in the first browser and disable extensions that block cookies. WordPress’s cookie documentation explains how to enable cookies in a browser.
Check Settings → General, or the values with wp option get home and wp option get siteurl. Both should use the same scheme and host, with https:// if you use HTTPS and no trailing slash. The WordPress developer documentation also describes setting WP_HOME and WP_SITEURL in wp-config.php. A mismatch between www and non-www makes the cookie belong to one host while you are on the other. The redirect side of this is covered in ERR_TOO_MANY_REDIRECTS in WordPress.
If the login screen shows “Cookies are blocked due to unexpected output”, something printed text, a space or a byte order mark before WordPress sent its cookies. The WordPress FAQ explains that this usually comes from blank lines or characters before an opening <?php tag or after a closing ?> tag, typically in wp-config.php or another edited PHP file, and that a file saved as UTF-8 with BOM can cause it. Check the file named in any “headers already sent” warning, save it as plain UTF-8 without BOM, or restore a clean copy.
Page caches, server caches and CDNs should never cache wp-login.php, /wp-admin/ or pages for logged-in users. Check your caching plugin and your host’s or CDN’s rules, clear all caches, and test again. Be careful with rules that cache by cookie.
If it started after a change, deactivate plugins. When you cannot reach the admin, the WordPress FAQ describes two methods: rename the plugins folder under wp-content (for example to plugins.hold) and log in, then rename it back and reactivate plugins one by one; or set the active_plugins option to a:0:{} in the database. Security, two-factor, login URL and caching plugins are the usual suspects. Our guide on finding the plugin that broke your site shows a safe order, and WordPress plugin conflict explains how to test. If a default theme fixes it, the theme is the cause.
No. A wrong password shows an error. A loop means the login succeeded but the session was not kept.
Yes, especially security, login and caching plugins. Test with plugins off.
Only when the problem is in your browser. If a private window also loops, the cause is on the site.
Yes with a backup. A single stray character can cause cookie errors, so edit carefully.
Related guide: WordPress Posts Showing 404 Errors: Fix Permalinks and Rewrite Rules
Related guide: “Sorry, You Are Not Allowed to Access This Page” in WordPress: Causes and Fixes
Related guide: WordPress Mixed Content Warnings After Installing SSL: Fix “Not Secure”
Rule out the browser, match the addresses, check output and caches, then test plugins. If you are locked out and need the site back, wpallsolution offers an emergency WordPress fix and plugin support. We cannot promise a result without seeing your setup.
A staging site lets you test updates on a copy before customers see them. Learn how to create one, lock it down…
Most break-ins start at the login screen. Use this practical checklist for passwords, two-step login, admin accounts, attempt limits and HTTPS.
Care plans give agencies steady work after launch. See how white label WordPress maintenance works, what to include and what to agree…
Black FridayCyber Monday sale
Before you go,
Our biggest discount of the year on the first payment of every maintenance plan.
BF2026 at checkout