How to Make Your WordPress Site Private

image8 How to Make Your WordPress Site Private For users who like to have a private (or restricted) WordPress site, there are several plugins that can restrict access to only registered users. However, I’ve had to search extensively for a solution that worked well with the current version of WordPress (v2.9.2).

In the end, after doing all the searching and finding information all over the place, the closest i got was to take an existing plugin that used to work with earlier versions and change a couple of things in it.

Because I did not wish to step on anyone’s toes, I’ve detailed two ways of achieving this:

  1. By taking the original plugin and making changes to it via the WordPress Dashboard
  2. By downloading a modified version of the original plugin and following the original authors instructions using this new script instead of his original one.

Both methods are detailed below.


Step 1

In the Dashboard, ensure that the Membership tick box under the General Setting is unchecked:

image thumb7 How to Make Your WordPress Site Private 

Step 2

Go download Angusman’s plugin and follow his instructions to download and install this plugin. Once you have installed it, do not activate it yet as we’ll be making a small change to it to support the latest version of WordPress

Step 3

Back in your Dashboard, go to your Manage Plugins page and locate Angusman’s plugin. Click on Edit to edit his plugin

image thumb8 How to Make Your WordPress Site Private

Step 4

When you get to the editing page, you’ll see the code for the plugin. Highlight the following code lines as below and delete them

image thumb9 How to Make Your WordPress Site Private

Replace the deleted lines with the following

if ( !is_user_logged_in() ) {

So the code will look like the following now – please be careful here and ensure the line is inserted in the correct position. Refer to the image below if you are not sure:

image thumb10 How to Make Your WordPress Site Private

The line you will insert will be directly below the comment that starts with “//Checks if a user…”

Click on Update File to save the file. You will get a “File Edited Successfully” message at the top once it has saved.

Step 5

Click on the Plugins link again in the Dashboard left menu to be taken back to the list of Plugins and Activate the Plugin.

Everything should be working now as described on the original plugin author’s site.

Alternative Method

I’ve got a “fixed” version of the file available here as a download if anyone is feeling squeamish about changing code themselves. All credit goes to the original author and the only difference would be to download the file from the link below and follow the rest of the instructions from the original site.

Download link: http://www.newbtech.com/Files/ac_authenticator.zip

Lastly, note that this will make your blog private to registered users only. This includes RSS feed links. However, this will not protect individual images on your posts if the user knows the exact URL of the images.


About the Author
Author

dee Dee can sometimes be lazy in updating his blog.. feel free to give him a kick about anything you want to see on here! :)

Comments (1)
Leave a reply

Name (required)

Website