How it possible to redirect all users, even administrators after login to specific page? And also redirect users after successful registration? Any simplest way? For example I want to redirect users after login, to the “Updates” page of my website. And after registration, to the “Home” page of website.
4 comments
Comments are closed.
This code adapted from: Registration Redirect
This code adapted from: Login Redirect
Add the code to the functions.php theme (or child theme) file.
To add one more to the list for logout:
To globally redirect after successful login, find this code in
wp-login.php
, under<form name="loginform">
section.and replace
<?php echo esc_attr($redirect_to); ?>
with your URL where you want to redirect. The URL must start withhttp://
and ends on/
other wise page redirect to default location.Do same thing form redirect after registration with in same file but under
<form name="registerform">
section.Edit:
This method involves changing WordPress core code. It is rarely recommended by any serious WordPress programmer. Proceed at your own risk.
With plugin:
Enjoy!