Restrict page to members only does not work for page ID, slug or page title
The init hook is called too early for your needs. And you should use wp_redirect(). Try this: function contactusnot() { if ( ! is_user_logged_in() && (is_page( 220 ) || is_page( ‘Contact us’ ) || is_page( ‘contact-us’ ))) { wp_redirect( ‘https://google.com/’ ); exit; } } add_action( ‘template_redirect’, ‘contactusnot’ );