Yesterday, I tried to clone an online website to localhost for doing some work on my theme.

I did a fresh Wordpress install on localhost and used mysqldump for copying the remote DB to localhost. I copied my theme to themes and finally, I ran UPDATE on site_url and home in wp_options. This process worked fine for me a couple of times in the past.

After doing so, I couldn't log in: when I enter correct credentials, login.php redirects to itself without any error or warning. On entering incorrect credentials, I get the "bouncing" message that they're not right, as it should work.

This problem disappears when I UPDATE current_theme, stylesheet and template to twentyfifteen in wp_options.

That is, I can log in fine when twentyfifteen is activated but as soon as I activate my own theme, Wordpress asks me to log in again which I then can't anymore. Does that make any sense?

Oddly, I can see my site on localhost correctly displaying my own theme as a non logged in visitor! However, I do need the aforementioned MySQL query for setting the theme back in order to log in.

What -if anything- in my theme could cause such symptoms?

On the (OK) live version I run the Rename wp-login.php plugin. I did not install it on the problematic local site but I do see the alternative login URL in wp_options. It seems unlikely to me that this is related to the problem but I wanted to mention this anyway.Result after attempting login

  • I can't say what is different in your theme, but there are still plenty of URL's to change when you do such a migration. Run a plugin like Velvet Blues Update URL's and update all your URL's accordingly. Then flush your permalinks afterwards Jul 7, 2015 at 8:20
  • Thanks for the suggestion but it didn't solve the problem.
    – RubenGeert
    Jul 7, 2015 at 14:39
  • You should post your update/solution as an answer, instead of an edit. It's OK to answer your own question, and you can even choose to accept it after 48 hours.
    – Gabriel
    Jul 7, 2015 at 15:34

1 Answer 1


Because the problem is theme specific, I guessed that perhaps something in functions.php could be the culprit. I renamed the file to some random string and this resolved the problem.

I then experimented by commenting out sections of functions.phpand discovered that wp_reset_password(...) caused the problem. I needed it only once anyway, so I removed it and I'm now living happily ever after.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.