Print This page

How To Prevent LoginPress Login Redirects(Hook)?

If you don’t want to use the LoginPress login redirect URL in your WordPress website then you can use the follow Hook to prevent the LoginPress login redirects.

Simply you need to add the following piece of code in your Child Theme’s file functions.php and update the file.

function prevent_loginpress_login_redirect_callback( $condition ) {
if ( //your condition ) {
$condition = 'true';
return $condition;
add_filter( 'prevent_loginpress_login_redirect', 'prevent_loginpress_login_redirect_callback', 10, 1 );

Here $condition contains the boolean valuetrue for no redirection.

That’s how you can easily prevent the LoginPress login redirects. Check our complete guide on how to prevent the LoginPress logout redirects.