WordPress is the top choice for most users looking to launch blogs. The multi-functional and user-friendly CMS gives you the freedom to do wonders with your creative online project. You can also make your WordPress blog private so that only a select group of users can read it. How can you make your WordPress website private? Let’s discuss this in the article.

Why do you need to make your WordPress blog private?

It may seem counterintuitive to make your website private. However, there are some cases when hiding your web resource from the public may be an essential step. For example, you may want to hide your WordPress blog during development. It allows you to work on your website’s content without worrying about your blog’s ranking and other factors. You also get a chance to scan your website for issues before it goes live.  

There are also cases when you need to build your website only for people within your organization. You can hide a few pages or make the entire website private in such cases. By hiding a small part of your website, you can make several chosen pages accessible to several people within your organization. This approach is in big demand on websites that feature members-only sections. You may also opt for a more straightforward process and hide the entire webpage from public access. Whichever way you choose to go, let’s see how both methods work.

How to Make Entire WordPress Blog Private

There are several ways to make your WordPress blog private, depending on your needs and goals. 

  • You can go by hiding your entire website using inbuilt WordPress features. This way, you will hide your website from getting indexed by search engines, making your content accessible to people who know your website’s address. 
  • If you consider driving referral traffic to your website, you can use guest post services to distribute guest posts to other web resources. Even if your  WordPress blog is hidden, users who click on anchor texts pointing to your private website can still access your content.
  • Using a dedicated plugin, you can also hide your WordPress site from search engines and general traffic. 

Hiding WordPress from search engines using inbuilt settings 

While choosing this method, you can hide your WordPress blog so that search engines like Google, Bing, Yahoo, etc., won’t be able to index it. However, everyone who knows your website will be able to access it. This approach is especially useful to everyone who has only started building a new WordPress site and needs more time to troubleshoot potential issues without worrying about SERPs. 

Using WordPress inbuilt features lets you easily hide your WordPress blog from search engines. Simply log in to your WordPress dashboard and navigate to Settings > Reading. By clicking on the Reading sub-menu, you will see the Search engine visibility options. Check the box to discourage the discoverability of your site. Click save the changes, and that’s it. 

Using a dedicated plugin

If you decide to put your website under construction after it goes live, making your WordPress blog private using the method discussed above won’t work. Hiding it from search engines using inbuilt features isn’t enough because some people who know your website address will be able to reach it. In such cases, using a dedicated WordPress plugin should be a better choice for you. 

Several plugins let you hide your WordPress blog after it goes public. My Private Site is one of them. It lets you make your WordPress site private. Even those who know your website address won’t be able to access it. 

My Private Site is a free plugin, which you can download and activate right from your WordPress dashboard. After the plugin is activated, you will find the My Private Site menu at the bottom left sidebar. Click on the checkbox to enable the login privacy settings and save the changes to make your WordPress blog private. 

Without a plugin

It’s also possible to make your WordPress blog private without using a plugin. This method suggests that you add several lines of code to the child theme’s functions.php. Navigate to your WordPress blog’s dashboard, select Appearance, and click on the Editor. Theme Functions will appear on the right side. Click it. The functions.php file will show up on the right side. At the bottom of the existing code, paste the following snippet:

function make_wordpress_site_private(){
  global $wp;
  if (!is_user_logged_in() && $GLOBALS['pagenow'] !== 'wp-login.php'){
    wp_redirect(wp_login_url($wp -> request));
    exit;
  }
}
add_action('wp', 'make_wordpress_site_private');

Click “update file,” and your website will go private. By using this code, you can direct visitors to a login page, where they can sign in using the accounts you’ve created for them. 

You can use another code to direct unauthorized users to a 403 forbidden page. It works only for Apache-based websites. Add the following lines of code to your website’s .htaccess file.

order deny,allow
deny from all
allow from 123.45.67.89

Replace digits in the last line with your IP address. 

Using this code is more advised for websites in the “under construction” status, and only a few developers can access it. 

In conclusion

You can choose your preferred method of making your WordPress blog private. Whether you want your website to remain available for the users who know its address or not, you can always find a solution to hide your WordPress blog without spending much time. In most cases, you can achieve the desired results without modifying the code. Use the methods described above or ask for professional help whenever you need to make a WordPress blog private. 

More articles by themes
If you notice that your website starts redirecting users to unknown websites, it is likely it was hacked. WordPress...
If you notice your WordPress website doesn’t load as fast as it used to, chances are its performance is...
Security is all we need. There are many ways to make your website a safer place on the Internet....

Contact

Feel free to reach out with a member of our team! We are excited to begin our collaboration!
Alex Osmichenko
Alex Osmichenko
CEO, Founder
Dima Osmichenko
Dima Osmichenko
COO
Clutch Logo
Reviewed on Clutch

Send a Project Brief

Fill out and send a form. Our Advisor Team will contact you promptly!

    Note: We will not spam you and your contact information will not be shared.