Create a Robust Directory and Individual Profiles for Your WordPress Membership Site

An important feature for many membership sites is the ability to display a dynamic directory of members and profile pages. Here is some information on how to add and customize these features using the Member Directory and Profile Pages Add On for Paid Memberships Pro.


Before you get started, consider this.

While a directory may be a desirable feature of membership, it is important to make it clear to your members what information will be made public or displayed privately. You can communicate what information will be shown, and what other members are allowed to do with that information via a Terms of Service agreement or elsewhere on your site.

Some points to include in this message would be:

  1. Can members directly contact another member via email?
  2. Can members copy the list of all members and send them mass email?
  3. Can a member opt to exclude themselves from the directory or just hide specific information?
  4. What are the consequences for abusing your policy?

Creating the Directory and Profiles

The Add On page covers primary documentation for the Member Directory and Profile Pages plugin. This includes the basic steps of generating the pages under Memberships > Page Settings and customizing the shortcode to display your unique fields.

Below are a few recipes, tips and tricks to make your directory even more robust.

  1. Capturing Additional Member Fields

    Our Register Helper Add On allows you to add new profile fields at membership checkout. This is a key plugin used by most membership sites that have unique fields based on the topic of their membership site. Some examples may include a file upload, such as a restaurant menu or resume, or business categories, such as “Small Business” or “Non-Profit”.

  2. Hide or Show Fields on Member Profiles based on Membership Level

    For many membership sites, a feature of higher-tier membership is the additional of more profile fields on the member directory, perhaps three videos or audio embeds, additional logos or photographs of a business location, or expanded contact information (website, phone, email). This can be achieved via the code recipe outlined in the link above.

  3. Allow Members to Upload an Avatar or “Logo”

    If you are planning to include images in your directory, this post outlines some recommended plugins for user avatar management on your WordPress site.

  4. Capturing Default WordPress Profiles Fields for your Directory

    The WordPress User profile already includes some key fields you may want to leverage for your membership site, such as “Site URL”, and “Description” (or biographical info). This post covers how to capture those fields for display on user profiles.

  5. Frontend Profile Field Management

    While we may eventually role this into the Add On, we recommend using the “Themes Profiles” module of the Theme My Login plugin to allow members to edit their profile fields in the frontend theme of your WordPress membership site. View the plugin in the WordPress.org repository »


Who can see the member directory and profiles?

There are a few methods to control the directory and profile visibility. It may take a little creative thinking to wrap your brain around the examples below, so please open a topic on the members forum and we will be happy to help you achieve your goals.

  1. Using the Page’s “Require Membership” Settings

    Set Membership Restrictions for a Page If your directory is visible to members only, you can control the content access to the page you place the directory shortcode on just like you do any other piece of member content. Simply edit the directory or profile page and check the appropriate level(s) in the “Require Membership” meta box.

  2. Using the [membership] Shortcode

    You can duplicate the directory or profile page shortcode and wrap it within the [membership] shortcode to show a unique member directory by level, this can take many shapes, such as Level 1 Members only being able to see other Level 1 Members, or Level 2 Members not being able to see full member email addresses, while Level 1 members cannot view this information.

    Here is an example of this method:

    [membership level="1"]
    [pmpro_member_directory levels="1"]
    [/membership]
     
    [membership level="2"]
    [pmpro_member_directory levels="2"]
    [/membership]

Want a better search, category filters or sorting?

We’re always working to example the features of this and all of our Add Ons. So if the unique directory options you need aren’t covered by the tips above, please post a comment below or open a topic on the member’s forum.

Member Directory Add On Enhancements: New Formatting, Added Fields, NEW User Profiles

pmpro_member_directory-avatarsEnhance your membership site with a public or private, searchable directory and NEW member profiles. The add on includes two shortcodes, which can be customized with easy-to-define attributes.

Member Profiles have special handling for file-type fields (audio, video, image, document, YouTube, Vimeo). The shortcode will embed or display based on mime type.

View the Add On


Directory and Profile Shortcode Attributes

pmpro_member-directoryShortcode attributes for [pmpro_member_directory] include:
  • avatar_size: The square pixel dimensions of the avatar to display. Requires the “show_avatar” attribute to be set to ‘true’. default: ‘128’ (accepts any numerical value).
  • fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields=”Company,company;Website,user_url”).
  • layout: The format of the directory. default: div (accepts ‘table’, ‘div’, ‘2col’, ‘3col’, and ‘4col’).
  • levels: The level ID or a comma-separated list of level IDs to include in the directory. default: all levels (accepts a single level ID or a comma-separated list of IDs).
  • limit: the number of members to display per page
  • link: Optionally link the member directory item to the single member profile page. default: true (accepts ‘true’ or ‘false’).
  • order: Sort the results based on the order_by attribute in ascending or descending order. default: ASC (accepts ‘DESC’ or ‘ASC’).
  • order_by: The sort order for the results. default: ‘u.display_name’ (accepts ‘u.user_email’, ‘u.user_email’, ‘u.display_name’, ‘u.user_login’, ‘u.user_registered’, ‘mu.membership_id’, ‘mu.startdate’, ‘joindate’)
  • show_avatar: Display the user’s avatar generated via Gravatar or user-submitted using a plugin like Simple Local Avatars; default: true (accepts ‘true’ or ‘false’).
  • show_email: Display the user’s email address; default: true (accepts ‘true’ or ‘false’).
  • show_level: Display the user’s membership level; default: true (accepts ‘true’ or ‘false’).
  • show_search: Display a search form (searches on member display name or email address); default: true (accepts ‘true’ or ‘false’).
  • show_startdate: Display the user’s membership start date for their current level; default: true (accepts ‘true’ or ‘false’).

pmpro_member-profileShortcode attributes for [pmpro_member_profile] include:
  • avatar_size: The square pixel dimensions of the avatar to display. Requires the “show_avatar” attribute to be set to ‘true’. default: ‘128’ (accepts any numerical value).
  • fields: Display additional user meta fields. default: none (accepts a list of label names and field IDs, i.e. fields=”Company,company;Website,user_url”).
  • levels: The level ID or a comma-separated list of level IDs that allow profiles. default: all levels (accepts a single level ID or a comma-separated list of IDs).
  • show_avatar: Display the user’s avatar generated via Gravatar or user-submitted using a plugin like Simple Local Avatars; default: true (accepts ‘true’ or ‘false’).
  • show_bio: Display the user’s bio (if available); default: true (accepts ‘true’ or ‘false’).
  • show_billing: Display the user’s billing address (if available); default: true (accepts ‘true’ or ‘false’).
  • show_email: Display the user’s email address; default: true (accepts ‘true’ or ‘false’).
  • show_name: Display the user’s display name; default: true (accepts ‘true’ or ‘false’). Use our Force First Last plugin to batch update display names.
  • show_level: Display the user’s membership level; default: true (accepts ‘true’ or ‘false’).
  • show_phone: Display the user’s billing phone (if available); default: true (accepts ‘true’ or ‘false’).
  • show_search: Display a search form (searches on member display name or email address); default: true (accepts ‘true’ or ‘false’).
  • show_startdate: Display the user’s membership start date for their current level; default: true (accepts ‘true’ or ‘false’).
  • user_id: Show a specific member’s profile; default: none (accepts any numeric uesr id, i.e. user_id=”125″).

Members can opt out of the member directory by checking the “Hide from Directory?” field on the “Edit Profile” page.


Notes about File-type Fields

If you are displaying a field that is a file type (audio, video, image, document), the shortcode will attempt to embed or display the file based on the mime type (about WordPress filetypes).


Notes about other Third-Party embeddable links (YouTube, Vimeo, etc.)

The field will also display as an embed (list of supported sites here) if the field value can be embedded via oEmbed (about WordPress oEmbeds).


Installation

  1. Members with a valid PMPro Plus license can install and activate this add on via the Memberships > Add Ons admin page. Or, download the zip file (above) and upload the ‘pmpro-member-directory’ directory to the ‘/wp-content/plugins/’ directory of your site.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress.
  3. Create a page for your directory and set the appropriate shortcode attributes and “Require Membership” settings per your needs.
  4. Create a page for your profile and set the appropriate shortcode attributes and “Require Membership” settings per your needs.
  5. Navigate to Memberships > Page Settings to assign your pages to the Directory and Profile page settings.
View the Add On

Shortcode Examples

Show only level IDs 1 and 4, hide avatars and email address:

[pmpro_member_directory levels="1,4" show_avatar="false" show_email="false"]

Show all level IDs, hide level name and start date:

[pmpro_member_directory show_level="false" show_startdate="false"]

Show a unique member directory by level. Level 1 Members can only see other Level 1 Members…:

[membership level="1"]
[pmpro_member_directory levels="1"]
[/membership]
 
[membership level="2"]
[pmpro_member_directory levels="2"]
[/membership]
 
[membership level="3"]
[pmpro_member_directory levels="3"]
[/membership]

Show unique member profiles based on level – hide user phone number and email address.

[membership level="1"]
[pmpro_member_profile show_email="false" show_phone="false"]
[/membership]
 
[membership level="2"]
[pmpro_member_profile show_email="true" show_phone="true"]
[/membership]

Screenshots

Member Directory – 4 Column Layout
pmpro_member_directory-avatars


Member Directory – Table Layout
pmpro_member-directory-table


Member Profile
pmpro_member-profile


Member Profile with File Embeds
pmpro_member_profile-files