How to redirect non-logged in users to a specific page?
Here are 2 examples which you will need to modify slightly to get it working for your specific needs. add_action( ‘admin_init’, ‘redirect_non_logged_users_to_specific_page’ ); function redirect_non_logged_users_to_specific_page() { if ( !is_user_logged_in() && is_page(‘add page slug or ID here’) && $_SERVER[‘PHP_SELF’] != ‘/wp-admin/admin-ajax.php’ ) { wp_redirect( ‘http://www.example.dev/page/’ ); exit; } } Put this in your child theme functions … Read more