// plain
Redirecting to another page in WordPress using PHP is a simple process. The following example code block will redirect the user to a page with the URL http://example.com/new-page
:
wp_redirect( 'http://example.com/new-page' );
exit;
The code consists of two parts:
wp_redirect()
: This function redirects the user to the specified URL.exit;
: This statement terminates the script execution.
For more information, please refer to the WordPress Codex.
onelinerhub: How to redirect to another page in WordPress using PHP?