I'm doing a custom form where the user can change is password. After submission and if the password is according to the rules I save the new one, overriding the old one, to the database, delete the cache and do the logout and signon of the user. Right now after that it's redirecting do the homepage, but what I want to do after is to redirect the user to a specific page, where I show a message, instead of going to the homepage. Can anyone help me with this?

Thank you!

  • Do you have any piece of code to show? – Domain Sep 17 '14 at 17:14

As you said you have a custom form, I am assuming you are not going to use WordPress default 'reset password' functionality.

You can use wp_redirect or wp_safe_redirect to redirect to a specific page after a particular condition (e.g. if the password is changed successfully)

| improve this answer | |
  • Thank you! I was making some mistake and that was why it wasn't working correctly, and with your help I found the mistake. And yes you'te assuming correctly, I'm not using the 'reset password' funcionality – Rui Silva Sep 17 '14 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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