ClickCease How to Make a WordPress Blog Private - With/Without a Plugin

WordPressWordPressOpen-source content management system (CMS) that allows users to create and manage websites and blogs.
More About WordPress
is the top choice for most users looking to launch blogs. The multi-functional and user-friendly CMSCMSA content management system is software aiding users to create, manage, and modify website content.
More About 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 trafficTrafficThe number of visitors or users who visit a particular website.
    More About 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 pluginPluginA piece of software that can be easily installed and activated on a CMS platform to enhance its capabilities.
    More About 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 sidebarSidebarA vertical column that appears alongside the main content, providing additional information, links, or widgets that are relevant to the main content.
More About 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 EditorEditorThe interface that allows you to write and format text, add images, embed media, and much more.
More About 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 snippetSnippetThe summary or preview of a webpage that appears beneath the title and URL.
More About 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 ApacheApacheA web server software widely used for hosting web applications.
More About 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 addressIP AddressInternet Protocol address is a numerical label assigned to each device connected to a computer network that uses the Internet Protocol for communication.
More About 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. 

Let’s discuss your project
Get quote
More Articles by Topic
Can you imagine your life without ordering the delivery of a meal from your favorite restaurant, downloading a new electronic…
The number of businesses launching ecommerce grows by leaps and bounds. With nearly $11 trillion of growth projected for 2025,…
The importance of making your website accessible is undeniable. Accessibility should be a priority from the start when designing and…

Contact

Feel free to reach out! We are excited to begin our collaboration!
Alex Osmichenko
Alex
Business Consultant
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.