Safe Redirect

wp_safe_redirect() should be used whenever possible to prevent open redirect vulnerabilities. One of the main uses of an open redirect vulnerability is to make phishing attacks more credible. In this case the user sees your (trusted) domain and might get redirected to an attacker controlled website aimed at stealing private information.

Valid: Redirect can only go to allowed domains.

<em>wp_safe_redirect</em>( $location );

Invalid: Unsafe redirect, can be abused.

<em>wp_redirect</em>( $location );