Simple way to make most of my site private
You can modify the above code to check for the pages you want to be accessible, else redirect to login: if (!is_user_logged_in() && $GLOBALS[‘pagenow’] !== ‘wp-login.php’ && !is_page(array(‘page1’, ‘page2’, ‘page3’)) ) You can check the documentation for is_page here: https://developer.wordpress.org/reference/functions/is_page