Documentation

Print This page

How To Prevent LoginPress LogOut Redirects (Hook)

If you don’t want to use the LoginPress logout redirect URL in your WordPress website then you can use the following Hook to prevent the LoginPress logout 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_logout_redirect_callback( $condition ) {
if ( //your condition ) {
$condition = 'true';
}
return $condition;
}
add_filter( 'prevent_loginpress_logout_redirect', 'prevent_loginpress_logout_redirect_callback', 10, 1 );

Here $condition contains the boolean value. true for no redirection.

This is how you can easily prevent the LoginPress logout redirects. Check our complete guide on how to prevent the LoginPress login redirects.