Redirect user after login to prior page through a wp_login hook
You can simply get the page where the user is coming from using $_SERVER[“HTTP_REFERER”] and replace your redirect to the homepage like below: // if meta exists, and the user information is up to date, redirect to homepage else { $redirect = $_SERVER[“HTTP_REFERER”]; wp_redirect( $redirect ); exit; }