Make a WordPress Site Private With or Without a Plugin

Most websites are built for the specific purpose of earning new readers and customers. But while many site owners strive to keep their online doors as wide open as possible, others aim to make private WordPress sites instead.

Fortunately, the WordPress platform makes it easy to hide your content from search engines or the general public. This is true whether you want to make a WordPress site private during development or on a more permanent basis.

Why would I want to hide my website?

Many experienced webmasters will make a budding website private until launch. This allows the individual to fill a new site with content and to troubleshoot any issues without an audience. Only after content has been added and a site’s theme finalized will the webmaster make his or her site public.

Verde Coming Soon Page

Other websites should never be made public at all. Take a website built for family members or for use within a small company, for instance. Sites like these include content intended for only a handful of readers. In cases like these, it’s completely reasonable and often advisable to make a WordPress site private indefinitely.

Before you proceed, decide whether you need to hide part of your website or all of it. The best approach will depend on your needs.

How do I make my entire WordPress site private?

If you simply don’t want your website to show up in search engines, head to the Reading screen of the WordPress Settings control panel. From here, make sure the “Discourage search engines from indexing this site” box is checked then save your changes.

You can also prevent public access of any kind to your website. In order to do this, you’ll need to install a plugin like My Private Site from David Gewirtz.

There’s a big difference between a site that is hidden from search engines and one that is truly private. Even if you’ve discouraged search indexing, visitors who know your website address can continue to browse. Alternatively, plugins like My Private Site offer greater control over website visibility and will block public access entirely.

Hide a WordPress site from search engines

WordPress offers a built-in toggle for those who want to hide websites from search engines like Google and Bing. You will find this checkbox near the bottom of the Reading settings screen. It’s labeled “Discourage search engines from indexing this site” and is off by default.

Discourage Search Engines Checkbox

If your website is brand new and you’ve yet to announce that it exists, chances are good that no one knows the URL. And as long as your work in progress doesn’t contain any sensitive information, this toggle might be enough to make your WordPress site private until launch. It won’t prevent those with your website’s address from visiting, but it will make the URL much harder to find.

When checked, this option serves as an effective way to temporarily keep your website out of search engines. But if you can’t risk anyone finding your website through other sources before (or after) it’s finished, you’ll need to take additional steps. Your next line of defense is a plugin designed to block public access of any kind.

Make a WordPress site private with a plugin

When hiding your website from search engines isn’t enough, you can install a free plugin like My Private Site to prevent visits from the outside world. With this approach, anyone who visits your website without an account will be directed to the WordPress login screen.

My Private Site WordPress Plugin

My Private Site will make your entire WordPress site private. As long as it’s active, no one will be able to view your website even if they know the URL. This added level of protection makes My Private Site perfect for families and organizations who plan to never reveal their content to the public, while WordPress websites that are under construction can benefit from it as well.

To get started, hit the “Add New” item in your control panel’s Plugins submenu. From the Add Plugins screen, search for “My Private Site” by David Gewirtz then install and activate it.

The plugin will add a My Private Site tab and submenu to the admin menu. Click or tap the submenu’s “Site Privacy” link where you’ll find a checkbox labeled “Enable login privacy.” Check it and save your status changes. Your entire WordPress website is now private.

Make WordPress Site Private Checkbox

Next, head to your control panel’s General Settings screen to ensure that the “Anyone can register” option is disabled. While enabled, anyone can come along, create an account, and freely browse your private WordPress site.

As an administrator, you can continue to view and manage your private WordPress site as usual. Moreover, you can create accounts for your friends and family in order to grant them access to your site. Just navigate to the Users section of your WordPress control panel and add as many accounts as needed. The subscriber role will allow them to browse your site without giving them access to powerful admin tools.

Show a coming soon page with a plugin

Admittedly, an unexpected login screen may confuse visitors who have arrived at your website looking for content. When user experience is a top concern, turn to a premium plugin like Verde Coming Soon instead.

Verde WordPress Coming Soon Plugin

Available from CodeCanyon, Verde allows webmasters to show or hide a custom coming soon page as needed. Anyone who visits your site while the page is enabled will see a polished coming soon page instead of the default WordPress login screen.

Plugin settings allow site owners to add custom text to the page, custom images, and to display a launch countdown. Visitors, on the other hand, can share your site and subscribe to your email newsletter from the page.

Verde provides your visitors with a better experience during development and maintenance while keeping them engaged as your WordPress site remains private. This approach makes little sense for a site that will never be made public, but if you need to block public access temporarily, Verde is an elegant solution.

Make a WordPress site private without a plugin (advanced)

Power users tend to avoid plugins for simple tasks. These users can often accomplish the same goals with a few lines of code instead.

There are a couple of ways to make a WordPress site private without a plugin. The first method will work in most hosting environments and requires a quick addition to a theme’s functions.php file.

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

Once in place, this snippet will have the same effect as the My Private Site plugin. Users who are signed in will be able to browse without restrictions, while everyone else will be sent to the login screen.

Ideally, you would add this snippet to the child theme of a new website then remove it before going live. This would make the entire WordPress site private until launch. You could add the code to a parent theme in a pinch, but it would be lost during subsequent updates.

Alternatively, you could add the following lines to the top of your website’s .htaccess file. This approach won’t work if you’re not serving your site from an Apache environment, but if you are, the required rules are more succinct.

order deny,allow
deny from all
allow from

This block is less flexible and far more aggressive. Instead of directing unwelcome visitors to a login screen, the visitors will see a more generic “403 access forbidden” error. The appearance of this error will vary from one hosting environment to the next.

SiteGround 403 Forbidden Error

Only those connecting from the IP address supplied on the third line can browse your WordPress website. Therefore, it’s very important that you swap the placeholder IP with your own address.

Because this approach is more restrictive, it’s best saved for when you need to make a WordPress site private during development. Sites that are shared with others will be easier to maintain if they’re made private with an earlier method instead.

How do I remove a WordPress site from Google search?

Timing is key if you hope to hide and later unveil your new website effectively. If you forget to remove access restrictions after you go live, no one will be able to view your website. If, on the other hand, you make a WordPress website private too late, search engines may find and index it before you’re ready for anyone to see it.

Fortunately, Google offers a way for webmasters to remove specific URLs from search results. You’ll need to set your site up with Google Search Console in order to submit a removal request, but anyone who maintains a website of any size should be leveraging this free tool anyway.

To remove a WordPress site from Google search results, navigate to your verified Search Console property and then to the “Removals” tool from the sidebar. Next, hit the “New Request” button under the Temporary Removals tab.

Google Search Console Remove URL Request

The New Request popup should appear. Navigate to the panel’s “Temporarily Remove URL” tab if you’re not already there and enter the WordPress URL that you would like removed from Google search. If you need to remove multiple pages, enter the prefix of all indexed pages and toggle the “Remove all URLs with this prefix” radio button. Hit “Next” to send your request.

All removals processed through the tool are considered temporary and will expire after a few months. If you need for your pages to reappear before a request has expired, you can cancel the removal from the same Search Console screen. And in order to permanently remove WordPress content from Google Search, you’ll first need to make your WordPress site private using one of the methods outlined above.

How do I hide individual pages or posts?

As you’ve learned, you’ll need to install a plugin or add custom code in order to block access to your whole website. But if your goal is to protect individual pages or posts, the solution is far more straightforward.

To restrict access to specific entries, head to the WordPress editor and locate the “Status & visibility” section at the top of the Document tab. Click or tap the link to the right of the Visibility label to reveal your options for an individual page or post.

Block users without an account from pages or posts

By default, content visibility options include public, private, and password protected. The public setting is self-explanatory and it’s the default for all new content. If you want to block access to anyone without an account, choose “Private” instead.

Make WordPress Page Private

With this option, anyone who visits the entry without an account will receive a notice stating that the content wasn’t found. This notice is the same one that is displayed when a page or post doesn’t exist at all. You can visit the affected page in a private browser window to see this notice in action.

Unlike sitewide privacy settings covered earlier, this private content setting will block registered users with lesser roles as well. In fact, anyone without an editor or administrator account will be denied access to your private WordPress pages and posts.

Password protect pages or posts

An unmodified WordPress site offers a third and final option for webmasters looking to make a page or post private. The password protected option will hide content from anyone who is unable to enter a correct password after their request.

To enable this feature for any entry, select “Password Protected” from the editor’s Visibility dropdown. After making your selection, you’ll need to supply a password from the same dropdown.

Password Protect WordPress Page

The password you provide is not related to any user accounts or the WordPress login system. Instead, anyone who can provide the correct password can view your content whether they have an account or not.

Initially, visitors will see a password notice in place of page or post content. The password notice will be replaced with the protected content only after a guest has supplied a matching password.

Restrict pages or posts to paying subscribers

While WordPress doesn’t offer this feature out of the box, third-party plugins can transform standard sites into paid subscription websites. Plugins like these will hide pages and posts from public visitors but not from those who have paid for access.

Paid Member Subscriptions is one such plugin. With it, you can create multiple subscription options for your visitors to choose from and restrict access to all or just part of your website. You can even set your own term lengths and allow customers to subscribe to monthly, yearly, or lifetime plans.

WordPress Paid Member Subscriptions Plugin

Paid Member Subscriptions can be installed for free from the plugin repository. The free version includes a handful of great features, but you’ll need to upgrade to unlock recurring payments and additional payment gateways.

What are the implications of a private WordPress site?

When you make a WordPress site private by discouraging indexing from the Reading settings screen, you’re telling search engines, “I don’t want anyone to be able to find my content.” The public will still have access to your website if they know the address or click a link, but they won’t find it in Google or Bing.

Search engines will display your content in results after you’ve enabled indexing again, but not right away. You can speed up this process with tools like Google Search Console and Bing Webmaster Tools.

Bing Webmaster Tools Homepage

Alternatively, when you restrict access with My Private Site or WordPress visibility settings, you’re blocking public access of any kind. Methods like these will block search engines as well as visitors with your site’s address.

For these reasons, most site owners will not make a WordPress site private unless they’re still building or intend to keep it private for good. If you plan on making big changes to an established website over the course of several hours or days, you should show a coming soon page or build in a staging environment instead. Hosting provider SiteGround offers a handy staging area to customers on its GrowBig and GoGeek plans.

SiteGround Hosting Homepage

And if you do choose to make your website private during development, put systems in place that will remind you to make it public later. You would be shocked at the number of site owners that forget this crucial step then wonder why their finished websites aren’t showing up in search results weeks or months after launch.

WordPress will display a dashboard notice if you’ve discouraged indexing, but it’s easy to overlook. Instead of relying on this notice, install Yoast early in the development process. It goes to much greater lengths to alert you when search engines are unable to access your website. Set a calendar reminder ahead of your planned launch date for added peace of mind.

Which method will you use?

With native WordPress settings, you can hide your website from search engines and prevent public access to pages or posts. But to charge for or block access to your entire site, you’ll need to install a plugin or drop in a little code.

Consider your skill set and the needs of your audience then proceed accordingly. The best approach will be the one that protects your website’s sensitive content while allowing search engines and the general public to view everything else.

Our blog posts and email updates contain occasional affiliate links to third-party products and services. This means that we stand to earn a commission on any sales delivered with the links, but we do not recommend products or services that we don't use and love.