WordPressSecurityWeb Development

WordPress password reset not working (infinite loop)

By Armando J. Perez-Carreno

A WordPress password-reset infinite loop is almost always caused by page caching serving the old form back to users. Exclude the reset URL from cache and the loop ends.

A WordPress password-reset infinite loop — where clicking the reset link just returns the user to the login page over and over — is almost always caused by **page caching** serving a stale version of the reset form back to the user after submission. The fix is to exclude the password-reset URL (and usually `wp-login.php` entirely) from your caching plugin's cache rules. Below is how to diagnose it and the exact settings to change.

Your site is up, visitors are pouring in, everything looks fine — until someone tries to reset their password and gets stuck in a loop. I've seen this many times, so do not worry, there is almost always one quick fix.

WordPress is a great platform, and most of the features that you need (user management, user posting, password recovery, etc.) are all already included.

So why isn’t it working, you may ask.

If you are using a Caching plugin like W3 Total Cache, or if your hosting provider does Caching automatically for you, two pages need to be excluded from the cache.

The pages in question are: “my-account” and “lost-password”.

To fix this issue try the following steps (create backups before you do anything, of course):

If you have a Caching plugin

  • Disable your Caching plugin and test the Reset Password functionality. If it works, then you can be sure the issue resides there.
  • Go into your Caching plugin’s settings and exclude the “my-account” and “lost-password” pages from the Cache.

If your host handles Caching for you

  • Ask your hosting provider to disable Caching on your site temporarily. If that works, then the issue may reside with your host’s Cache.
  • Ask your hosting provider to exclude the “my-account” and “lost-password” pages from the Cache. Or just tell them what the issue is and they may already know what to do.

In my case, with WP-Engine (who BTW have magnificent support 24/7), I just told them what was happening, and their team knew what to do. They added the rules to Nginx, and the problem went away in seconds.

In summary, don’t be afraid to ask your hosting provider for suggestions on how to fix something that WordPress should do out of the box. Their willingness to help might surprise you!

Did you have this issue on your site? How did you resolve it? Comment below!

Published by Armando J. Perez-Carreno

Get started

Let's find your first automation.

Free 30-minute call. No pitch deck. No pressure.

Book a free call →