In that case, you have a few options depending on your needs. If you:
Just want to make your site private while you’re performing maintenance, you’ll probably be best off using a WordPress maintenance mode plugin.
Need a complicated private site where you’re able to accept payment in exchange for access to your site, then you’ll be best off with a WordPress membership plugin.
Want a basic private site where users need to log in to see your special lead content, you can use the My Private Site plugin that I’ll discuss below.
My Private Site is the most general private site plugin, so that’s why I’m going to use it for this tutorial on how to make your entire WordPress site private.
Make sure you install and activate the plugin first.
Step 1: Turn On Private Site Functionality
To make your site private after activating the plugin:

Go to Settings → Private Site on your WordPress dashboard
Check the box for Private Site
Save your changes
make a wordpress site private
At this point, your site is private. Anyone who isn’t already logged in will see the regular WordPress login page if they try to access any part of your site:
WordPress Login
You should still configure a few additional settings to control how things function, though.
Step 2: Decide If People Can Register Themselves On Your Site
Next, scroll down to the Allow Self-Registration section and choose whether or not to let people create an account at your site:
If you check the box, your site is still fairly public because anyone can create an account to see your content.
If you leave the box unchecked, you’ll need to manually create user accounts for all the people that you want to be able to see your site.
allow self registration in wordpress
Step 3: Control How Users Log In To Your Site
In the Landing Location and Custom Login sections, you can:
Choose which page a user goes to after they log in
Create your own custom login page to use instead of the default WordPress login page
landing location wordpress
Step 4: (Optional) Make Some Pages Public
If you still want to make some content on your site public, you can use the Visible Exclusions section to make:
Your homepage public
A specific piece of content public
An entire category public (using the URL Prefix feature)