php-wordpressHow to redirect to another page in WordPress using PHP?
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.
More of Php Wordpress
- How to use get_header in WordPress using PHP?
 - How to get the current URL in WordPress using PHP?
 - How to send an email using PHP in WordPress?
 - How to hide PHP warnings in WordPress?
 - How to increase the upload limit in WordPress using PHP?
 - How to use body_class() in WordPress with PHP?
 - How to disable PHP warnings in WordPress?
 - How to check the PHP version in WordPress?
 - How to create pagination in WordPress using PHP?
 - How to configure Nginx for WordPress?
 
See more codes...