1function redirect_to_home() {
2 if(!is_admin() && is_page('2')) {
3 wp_redirect(home_url());
4 exit();
5 }
6}
7add_action('template_redirect', 'redirect_to_home');
1add_action( 'template_redirect', 'redirect_to_other_page' );
2function redirect_to_other_page() {
3 if ( is_page( 143 ) ) {
4
5 wp_redirect( '"'.home_url().'/services/messenger/"', 301 );
6 ///wp_redirect( 'example.com/page', 301 );
7 exit;
8 }
9}