Accent Image
Pete on July 19th, 2008
Return to Plugin Homepage


Basic Concept

WP Sentry is a plugin which allows you to make otherwise private posts available to certain users of your site1. The functionality of WordPress’s private posts is extended to allow for granular user and group-based viewing of private posts.

User Groups

While groups are the basic unit of WP Sentry, they are not required. They do, however, become very useful as the number of registered members of your blog increases. Users can be members of as many groups as you’d like. This is managed in the ‘User Groups’ menu of the WP Sentry administration.

When you arrive at the page, you’ll be presented with a list of groups. New installations have no groups pre-defined. To add a group, simply type the group name in the appropriate box and select “Add Group”. The name of the group is totally up to you, and is only visible to users who have posting or user-editing privileges. The group listing will show the group’s name, how many members belong to that group, and how many posts members of that group have access to. To modify a group’s name or membership, click on the group name.

Multiple-Select Boxes

Many features of the site make use of multiple-select boxes. If you already know how to use these, please feel free to skip this section.

Clicking on any option in a multiple-select box will make the box select just that option (erasing all other selections). Holding down the ‘Control’ key will toggle a selection. To select more than one option, hold down the ‘Control’ key on your keyboard (or the ‘Option’ key if you’re on a Mac), and click all of the options you would like to be selected. To de-select an option, hold down ‘Control’ and click on the selected option you wish to de-select.

You can also select a range of options. To do that, click on the first option you wish to select. Then, hold down the ‘Shift’ key and click the last option in the list that you wish to select. If you have some selections already made and you want to add a range to it, follow the previous steps, but hold down the control key as well.

You can combine control-click, shift-click, and control-shift-click in a variety of ways to create your selections but, if you have trouble, remember that you can always just select each option individually using control-click.

Making a Private Post

In order to make use of your newly created groups, you will notice a new box toward the bottom of your Write Post screen called ‘User & Group Access’. It contains two multiple-select boxes. The box on the left contains your groups, while the box on the right contains your users. Before you publish, select which groups and users you wish to have access to the post.

There are three ways a logged-in user will be allowed to see a post:

  1. The user is selected individually from the box on the right,
  2. The user is a member of any group selected from the box on the left, or
  3. The ‘Allow All Registered Users’ option is selected from the box on the right

If you make use of the ability to create user groups, you will probably not use the box on the right very often. Remember, it isn’t necessary to select a user individually if they are a member of a group that you’re giving access too.

If any users or groups are selected, the post will be forced to be private. If you wish to make a post public, you will need to de-select all of the selected groups and users and then make sure the ‘Keep this page as private’ option2 is un-checked.

Private Post Previews

You may want to allow users who do not have permission to see a post to see a preview, to encourage them to log-in or register. This not enabled by default, but you can configure the previews through the ‘Preview Settings’ menu.

The first step is to determine what sort of preview you’d like to show. You have four options:

  • None — This disables previews entirely.
  • Title — Shows only the post titles
  • Excerpt — Shows the post titles and excerpt (if available)
  • Above-the-fold — Shows the post title and anything before a <–More –> tag

Note that with the “Above-the-fold” setting, posts that do not have a <–More –> break in them will not be visible at all (to prevent the user from seeing the whole post).

Typically, previews will be shown for every private post. If you wish to restrict that a bit, you can tick the checkbox below the previews setting to restrict the previews. If that box is checked, the only posts for which previews will be shown are those in which the ‘Allow All Registered Users’ option is selected in the right hand box of the Write Posts screen.

Preview Permalink
Because of a limitation of WordPress, there is no way to display these previews on the individual post page. As a result, enabling previews can create a large number of 404 errors. To remedy this, WP Sentry allows you to overwrite the permalink URLs for previewed entries with a URL of your own. It is recommended that this go to a page explaining how someone can gain access to the members-only section of your site.

To enable this feature, enter a URL in the ‘Preview Link’ section of the previews configuration screen. This option does not impact the permalinks of posts to which the user has permission.

Title Editing
By default, WordPress prepends the title of each private post with “Private: “. You can change this to anything you’d like by modifying the prefix and postfix in the ‘Private Titles’ section of the previews configuration screen. These boxes both accept any HTML you wish to put in them.

Denied Message
If WP Sentry is showing previews, but doesn’t have an excerpt or ‘above-the-fold’ section to display, it will output the message you put in this section of the previews configuration screen. It will accept any HTML. This message is also shown when you select ‘Title’ as your preview type.

Default Posting & User Groups

The ‘Default Groups’ option of the WP Sentry admin allows you to set two kinds of ‘default’ groups. The first is default groups for new posts. Any groups you select here will be automatically selected for new posts on the Write Post screen. When writing a post, these defaults may be de-selected if you wish for the post to be public.

You can also assign some default user groups. Any new member will be added to these groups. This works not only for new member registrations but also for those users created by blog administrators.

Recent Posts & Comments Widgets

While this should work with no input from you, WP Sentry disables the default wordpress “Recent Posts” and “Recent Comments” widgets because they don’t play nice with WP Sentry. The plugin replaces them (hopefully seamlessly) with its own, Sentry-enabled versions of the same. Most users will not notice any problems. If this causes a conflict or some other issue, please let me know so that I can correct it.



  1. This is only subtly different from hiding otherwise public posts from people who shouldn’t be allowed to see them.

  2. Located right below the ‘publish status’ in the right-hand column.

This website uses IntenseDebate comments, but they are not currently loaded because either your browser doesn't support JavaScript, or they didn't load fast enough.

One Response to “WP Sentry Help”

  1. Pete says:

    Please send an email to pete.holiday@gmail.com if you have questions or have found a bug. Thanks!