wp safe redirect
Use the wp_safe_redirect function in WordPress to safely redirect users to a specified URL. This function helps prevent open redirects and is used for creating safe redirects within WordPress.
Here's an example of how to use wp_safe_redirect:
$url = 'http://example.com/redirect-url';
wp_safe_redirect( $url );
exit;
Replace 'http://example.com/redirect-url' with the URL you want to redirect users to. By using wp_safe_redirect along with the exit statement, you ensure that the redirect is performed safely and efficiently.