When a user registers for a WordPress site, they are redirected to the login page after completing the registration form. Is there a way to redirect them to the previous page before filling out the registration form?
Please note that I’m not looking for a custom/static page because the user will be coming from various pages and that’s the page I want them to return to – not the same page for every case. Thanks!
There’s a
registration_redirect
filter you can use:Alternately, you can edit the PHP that is generating your
<form>
and add a hidden field namedredirect_to
, using the current page’s address (ie,$_SERVER['PHP_SELF']
).References
registration_redirect
on wpseek.com | in sourceesc_url()