How to Make a WordPress Site Private: Ensure Complete Privacy

how to make wordpress site private

In most cases, WordPress websites are created to be accessible to everyone, whether it’s a personal blog, a business site, or an online store. (In fact, that’s the purpose of the Internet!)

However, there are times when you might want to keep your site under wraps, only allowing specific people to view it. Whether you’re working on a project, building a personal portfolio, or creating a members-only area, making your WordPress site private is a great option. In this blog, we’ll show you how expert WordPress developers make a site private and discuss the best ways to control who gets access. Let’s dive in!

Why Make Your WordPress Site Private

There are several reasons why you might want to keep your WordPress site private. Here are a few common ones:

  • Work in Progress: If your website is still under development, making it private allows you to work without anyone seeing an unfinished product. It gives you the freedom to experiment and fine-tune your content before going live.
  • Personal Use: Some websites are meant to be personal, like a family blog, a private journal, or an internal project. You may not want everyone to have access, and keeping the site private ensures only select people can view it.
  • Members-Only Content: If you run a membership site or offer exclusive content, making certain sections or the entire site private is a great way to control access. It ensures that only those who have subscribed or registered can see the content.
  • Internal Company Website: Many businesses use WordPress to create internal websites for employees, such as intranets or private portals. By keeping it private, you ensure that sensitive company information stays secure and only authorized personnel can access it.
  • Limited Audience: Not every website needs to attract a wide audience. Maybe you’re creating a website for a small group, such as a team, class, or club, and you want to limit access to only those who are part of that group.

No matter the reason, making your WordPress site private gives you full control over who can view your content, helping you maintain privacy and focus on your goals.

How to Make an Entire WordPress Site Private

There are different methods to make the whole WordPress site private. For example, you can use WordPress’s built-in features to control your website accessibility, or you can take help from plugins.

Here, we will explore different options for making a WordPress site completely private.

Hide Your WordPress Site From Search Engines

This method prevents search engines like Google, Bing, and Yahoo from indexing your site, meaning it won’t appear on search engine results pages (SERPs). However, keep in mind that anyone who knows your site’s URL can still access it directly.

This option is perfect if you’re in the early stages of building your WordPress website. It allows you to work on your content and troubleshoot issues without worrying about visibility on search engines.

Here’s how to hide your site from search engines:

  • Log in to your WordPress admin dashboard.
  • Navigate to Settings > Reading.
  • Look for the option labeled Search Engine Visibility.
enabling Discourage search engines from indexing this site.
  • Check the box that says – “Discourage search engines from indexing this site.”
  • Click Save Changes.

Once your site is ready for the public, revisit this setting and uncheck the box to make your website visible to search engines again.

Hide Your WordPress Site With a Plugin

If your site was live for a while and now you want to make it private, hiding it from search engines won’t be enough. People who know the site’s URL will still be able to visit it. To fully restrict access, you’ll need to use a plugin.

Plugins are a simple way to make your entire WordPress site private. One of the most popular options is the My Private Site plugin, which ensures only registered users can access your content.

Here’s how to set it up:

  • Go to Plugins > Add New.
  • Search for My Private Site and install it.
  • Once installed, activate the plugin.
  • Navigate to My Private Site in the sidebar.
  • Open the Site Privacy tab.
 Enable login privacy
  • Check the box to Enable login privacy.
  • Click Save Changes.

With this setup, no one can view your website unless they have been granted access through a registered account.

Hide Your WordPress Site by Granting Access to Selected Users

If you’ve made your WordPress site private and want to allow specific users access, you can manually create accounts for them.

To grant members access:

  • Go to Users > Add New.
  • Create new accounts for the people you want to allow access.
Assign the Subscriber role
  • Assign the Subscriber role to ensure they can only view the content they’re supposed to, without accessing any administrative functions.
disable the Anyone Can Register option

Additionally, disable the Anyone Can Register option found under the Membership settings in the My Private Site plugin. This prevents random people from creating accounts and gaining access to your site.

Hide Your WordPress Site Without a Plugin

If you prefer not to use a plugin, you can make your WordPress site private by adding a few lines of code to the functions.php file in your child theme. Here’s the code snippet you need:

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');

How to implement this code:

  • Go to Appearance > Theme File Editor.
  • On the right side, find and click on Theme Functions (functions.php).
  • Paste the above code at the bottom of the file and click Update File.

This code will redirect any visitors who are not logged in to the login page. From there, they will need an account to access the site. To make your website public again, simply remove the code from the functions.php file.

If you want to restrict access even more, another code snippet can direct unauthorized visitors to a 403 Forbidden page:

order deny,allow
deny from all
allow from 123.AB.CD.EF

Replace “123.AB.CD.EF” with your actual IP address. This code should be added to your .htaccess file, which can be found in your website’s root directory.

Note: We recommend using this code-based option only if your site is under construction and you need to limit access to a few developers or team members. For private blogs, membership sites, or company portals, plugins or the previous code snippet offer better control.

Hide Your Site in WordPress.com

If you’re using WordPress.com, making your site private involves a slightly different process:

  • Go to Settings from the left-hand menu.
  • Scroll down until you find the Privacy section.
  • You’ll see three options: Coming Soon, Public, and Private.
  • Select Private to hide your site from all users except those you approve.
  • To allow specific users access to your site, use the Manage > People tab to invite other WordPress.com members to view your private website.

Keep in mind: WordPress.com sites are managed by Automattic, the company behind WordPress. This means they have access to data about your site’s users. Consider this when deciding whether to use WordPress.com or WordPress.org.

Ensure your WordPress site is perfectly private

How to Make Individual Pages/Posts Private in WordPress

If you don’t need to make your entire WordPress site private, you can easily hide individual pages or posts. WordPress has built-in features that allow you to do this without needing custom code or plugins. Let’s go through the different privacy options you can use.

Using a Password to Protect Pages/Posts

One of the easiest ways to hide a specific page or post in WordPress is by using the built-in password protection feature.

Here’s how to do it:

  • Open the page or post you want to protect.
  • In the Visibility settings, you’ll see three options: Public, Private, and Password Protected.
Make the page/post Password Protected
  • Select Password Protected, then create a password.
  • When visitors land on the page, instead of seeing the content, they’ll see a password request. Only those who know the password will be able to view the page.

If you need more advanced control over passwords, you can use a plugin like PPWP Pro. This plugin allows you to:

  • Set multiple passwords for a single page.
  • Assign specific user roles to different passwords, so only users with the correct role can access the content.
  • Secure several pages with a master password, enabling users to unlock multiple pieces of content with just one password.

How to Use PPWP:

  • Go to Plugins > Add New in your WordPress dashboard.
  • Search for password protect WordPress and install the PPWP Pro plugin.
  • After activation, go to Pages and select the page you want to protect.
  • In the Password Protect WordPress section, click Edit.
  • Enter your desired passwords. If you’re setting multiple passwords, list each one on a separate line.
  • Assign roles to specific passwords if necessary.

PPWP offers two password types:

  • Global Passwords: Allows all users with the password to access the page.
  • Roles Passwords: Only allows users with the correct password and user role to access the content. Unauthorized users will see an error message.

This method gives you more flexibility and control over who can access your private pages.

Showing Pages Only to Paid Subscribers

If you’re running a paid subscription service or want to monetize specific content, you can hide individual pages and make them accessible only to paid subscribers. This allows you to create premium content behind a paywall while keeping other parts of your site public.

WordPress doesn’t have a built-in solution for paid subscribers, but you can easily implement this with a plugin. Two popular plugins are Paid Memberships Pro and MemberSpace.

These kind of plugins help you to:

  • Create Membership Forms: Set up forms for users to subscribe and manage their accounts.
  • Create Subscription Plans: Offer different subscription levels, including hierarchical plans where users can upgrade.
  • Set Access Rules: Control who can view which content based on their subscription plan.
  • Content Visibility: Manage visibility for your pages or posts, ensuring only paid subscribers can access them.

This way, you can build a smooth, professional membership site that offers flexibility for both you and your users.

Setting Content Privacy for Admins and Editors

If you simply want to hide a page or post from the public while still allowing access to site admins and editors, WordPress offers a straightforward way to do this.

Here’s how:

  • Open the page or post you want to restrict.
  • In the Visibility settings, select Private.

This will hide the content from the public, but admins and editors will still have access. It’s a quick and easy way to control internal content visibility without impacting the rest of your site’s audience.

By using these privacy settings, you can easily protect sensitive content, control access, and even monetize your WordPress site with minimal effort.

FAQs on Making a WordPress Site Private

What is private visibility on WordPress?
Private visibility in WordPress means only authorized users (like admins or editors) can view the content. The public, even with the URL, cannot access it.
Who can see a WordPress website when it is set to private?
Only admins and editors can see a private WordPress site. Regular visitors or users without permission cannot access the content.
Can I create a paywall to hide certain pages or content on my WordPress site?
Yes, you can use plugins like Paid Memberships Pro or Member Space to set up a paywall and restrict access to specific content for paying subscribers.

Closing Thoughts

Whether you’re developing a new site, sharing personal projects, or restricting access to premium content, ensuring privacy for your WordPress site is important.

With options ranging from built-in WordPress features to plugins and custom code, you can tailor the level of privacy to suit your exact needs. For a quick fix, password protection or private visibility settings work well. If you’re looking for more advanced solutions, such as creating a paywall for subscribers or managing multiple user roles, plugins offer great flexibility.

Depending on your goals, choose the method that best suits your situation and ensures your content remains secure. And if you need help with these privacy settings or managing your WordPress site, consider hiring WordPress developers to streamline the process.

Struggling with WordPress privacy settings?

author
Chinmay Pandya is an accomplished tech enthusiast specializing in PHP, WordPress, and Laravel. With a solid background in web development, he brings expertise in crafting innovative solutions and optimizing performance for various projects.

Leave a comment