Add value to your membership, foster community, and build connections through member directories and listings. This Add On allows you to create a customizable Member Directory and individual Member Profile pages.

  • Member Directory Page: Dynamically lists members, presents essential profile information, avatars, and direct links to the individual Member Profile pages.
  • Member Profile Page: Highlights a specific member’s information. Customize the profile display with no-code User Fields to create a useful resource for each member that encourages exploration, interaction, and even generates business opportunities.
  • Customization Options: Build your Member Directory to fit your unique vision and set up specific visibility and access rules. Use the built-in WordPress blocks or shortcodes to arrange and display the directory, member profiles, and included user profile data based on membership level.

Installation

You must have the Paid Memberships Pro plugin installed and activated with a valid license type to use this Add On.

  1. Navigate to Memberships > Add Ons in the WordPress admin.
  2. Locate the Add On and click Install Now.
    • To install this plugin manually, download the .zip file above, then upload the compressed directory via the Plugins > Add New > Upload Plugin screen in the WordPress admin.
  3. Activate the plugin through the Plugins screen in the WordPress admin.

Member Directory and Profile Page Setup

Step 1: Create and Assign the Directory and Profile Pages

The first step of setup is to create and assign the pages that will display your Member Directory and Member Profiles. You can generate these pages automatically, or create them manually and assign in the settings.

  1. Navigate to Memberships > Settings > Pages in the WordPress admin.
  2. Locate the Additional Page Settings section.
  3. Click the Generate Page button to create a new page for your Member Directory and Member Profile. If you created these pages manually, assign them to the appropriate Page Settings after they are published.
  4. Save Settings.

Note: The Profile page should not be set to the same page or contain the same shortcode as your site’s “Member Profile Edit” page. The Directory’s Profile page is a static view of member data, whereas the Member Profile Edit page is where a single logged-in user can modify their profile information.

Step 2: Edit Your Member Directory

The Member Directory can be customized by changing attributes of the Shortcode [pmpro_member_directory] or adjusting the settings of the Member Directory Block.

Using the [pmpro_member_directory] Shortcode

Navigate to the WordPress page for your directory and click through to edit the page in the WordPress admin.

If you generated the Member Directory page, it will automatically include the following shortcode: [pmpro_member_directory]. Shortcode attributes include:

elements Attribute

The elements attribute controls what information is shown in the directory and the order the information is displayed.

This attribute accepts a list of label names (optional) and values in the format label,name; (e.g. elements="avatar|256;display_name;Company,company;Website,user_url".)

Supported values for the elements attribute include:

  • User Information: The user object data (stored in WordPress’ wp_user table), including: user_login, user_email, user_url, user_registered, or display_name.
  • User Meta Information: The user meta data (stored in WordPress’ wp_usermeta table). Use the name value of any custom User Field you’ve created or of any other usermeta field available in your site.
  • Membership Information: Details about the active membership, including: membership_name, membership_startdate, and membership_enddate.
  • Address Information: If you are using the Mailing Address Add On, you can display the member’s address using the field ID pmpro_mailing_address.
  • Avatar: Show the member’s avatar and customize the size shown. e.g. elements="Profile Picture,avatar|256".
layout Attribute

Choose the layout of your Directory. The layout attribute accepts the following values:

  • div: Display each member in its own full width block.
  • table: Display members in a table. Each element will be shown in its own column of the table.
  • 2col: Display members in two columns.
  • 3col: Display members in three columns.
  • 4col: Display members in four columns.
levels Attribute

The level ID or a comma-separated list of level IDs to include in the directory. By default, all membership levels will be included in the directory. (e.g. levels="1,2").

If your directory displays the member level names, and the member holds multiple levels, all of their active membership names will appear in a comma-separated list. This list is limited by the value of the levels attribute.

limit Attribute

The number of members to display per page

By default, every listing in your Directory will be linked to the Profile page for that member. You can remove this link and have a single Directory with no individual profiles by setting the link attribute to false (e.g. link="false").

order and order_by Attributes

The order_by attribute adjusts the sort order for the results. The directory is automatically sorted by the member’s display name. The order_by attribute accepts the following values: u.user_email, u.display_name, u.user_login, u.user_registered, mu.membership_id, mu.startdate, joindate.

The order attribute sorts the results based on the order_by attribute in ascending or descending order. default: ASC (accepts DESC or ASC).

show_search Attribute

Optionally hide the search form from the Directory. (e.g. show_search="false").

Using the Member Directory Block

Select the Member Directory Block to see block options, including:

  • 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
  • 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.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 Basic User 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’).

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

Step 3: Edit Your Member Profile

The Member Profile can be customized by changing attributes of the Shortcode [pmpro_member_profile] or adjusting the settings of the Member Profile Block.

Using the [pmpro_member_profile] Shortcode

Navigate to the WordPress page for your Member Profile and click through to edit the page in the WordPress admin.

If you generated the Member Profile page, it will automatically include the following shortcode: [pmpro_member_profile]. Shortcode attributes include:

elements Attribute

The elements attribute controls what information is shown in the Member Profile and the order the information is displayed.

This attribute accepts a list of label names (optional) and values in the format label,name; (e.g. elements="avatar|256;display_name;Company,company;Website,user_url".)

Supported values for the elements attribute include:

  • User Information: The user object data (stored in WordPress’ wp_user table), including: user_login, user_email, user_url, user_registered, or display_name.
  • User Meta Information: The user meta data (stored in WordPress’ wp_usermeta table). Use the name value of any custom User Field you’ve created or of any other usermeta field available in your site.
  • Membership Information: Details about the active membership, including: membership_name, membership_startdate, and membership_enddate.
  • Address Information: If you are using the Mailing Address Add On, you can display the member’s address using the field ID pmpro_mailing_address.
  • Avatar: Show the member’s avatar and customize the size shown. e.g. elements="Profile Picture,avatar|256".
levels Attribute

The level ID or a comma-separated list of level IDs that support a Member Profile page. The member must have the specific level ID(s) to have their Member Profile displayed, otherwise the page will redirect back to the Member Directory page.

The order attribute sorts the results based on the order_by attribute in ascending or descending order. default: ASC (accepts DESC or ASC).

show_search Attribute

Optionally hide the search form from the Profile. (e.g. show_search="false").

user_id Attribute

Optionally show a specific user’s profile. This attribute is only necessary if you are building each member’s profile individually. (e.g. user_id="31").

Using the Member Profile Block

Select the Member Profile Block to see block options, including:

  • 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 Basic User Avatars; default: true (accepts ‘true’ or ‘false’).
  • show_bio: Display the user’s bio (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_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″).

If the shortcode, block, and available hooks and filters do not offer the level of customization you require, refer to this guide on How to Load a Custom Template for Your Member Directory and Profiles.

Step 4: Allow Members to Control Profile Visibility

Members can remove their profile from being included in the Directory. The Add On automatically adds this setting to the Member Profile Edit page. A member or admin can check the box to hide their profile and they will be immediately removed from the Directory and Profile.

Admins also have the ability to remove a member from the directory via the “Directory and Profile Preferences” panel on the Edit Member screen. A member or admin can check the box to hide their profile and they will be immediately removed from the Directory and Profile.

Screenshot of the Directory and Profile Preferences panel on the Edit Member screen

You can also let members opt out of the directory as part of membership checkout. Follow these steps to create a User Field that adds an “Exclude my profile from the member directory” field at membership checkout:

  1. Navigate to Memberships > Settings > User Fields in the WordPress admin.
  2. Click the “+ Add Field Group” button.
  3. Enter your preferred title for the group in the “Group Name” field, e.g. “Hide from Directory?”.
  4. Select “Yes” for the “Show fields at checkout?” option.
  5. Select “No” for the “Show fields on user profile?” option.
  6. Click the “+ Add Field” button.
  7. Enter your preferred title for the field in the “Label” field, e.g. “Exclude my profile from the member directory”.
  8. Enter pmpromd_hide_directory in the field’s “Name” field.
  9. Select “Checkbox” from the field “Type” dropdown.
  10. Click on the “Save All Changes” button to create and save the new field group and field.
A screenshot of adding a user field in Paid Memberships Pro and

The [pmpro_member_directory_search] shortcode is used to display a search form for the Member Directory Add On. This allows users to search for members within the directory.

To add a search form to any page or post, simply include the shortcode in the content editor:

[pmpro_member_directory_search]

Restrict the directory search with the Content Visibility block or shortcode.

Customizations, Theme Compatibility, and Styling

File-Type Profile 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).

  • Audio files will embed using the WordPress [audio] shortcode
  • Document files will display the appropriate wp_mime_type_icon and a link to view or download the file
  • Image files will display as a standard image on the page at full size
  • Video files will embed using the WordPress [video] shortcode

Third-Party Embeddable Links

If your members have a profile field that links to a third-party embeddable platform like YouTube, Vimeo, and others, the field will also display as an embed. See a list of supported oembed sites here.

By default, the search fields in this Add On will search the following profile values: user_login, user_email, display_name, and all usermeta fields.

Some servers may not allow the large queries needed to execute a directory and profiles search. You will know this is the case if you are using the search form and no results are returned when you know results should be returned.

The recipe below can be used to allow your hosting environment to process the large JOIN operations needed for this Add On.

Administrator Role Only: Security Features

The Member Directory and Profile blocks and shortcodes are very powerful. They are each capable of outputting user and user meta field for the logged in user. For this reason and the potential privacy and security risks associated with displaying user info, only users with the edit_users capability (given to people with the Administrator role) can add this block or shortcode to content.

Shortcode Examples

Display select information for only level IDs 1 and 4.

[pmpro_member_directory levels="1,4" elements="display_name;Level,membership_name;Member Since,membership_startdate"]

Show just the name, avatar, and email address for all level IDs.

[pmpro_member_directory elements="display_name,avatar,user_email"]

Display custom user fields using the “elements” attribute in the format Label,key;Label,key:

[pmpro_member_directory elements="avatar|128;display_name;Company,company;Website,user_url"]

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: do not include email address for level ID 1 members.

[membership level="1"]
[pmpro_member_profile elements="display_name;avatar;Level,membership_name"]
[/membership]

[membership level="2"]
[pmpro_member_profile elements="display_name;avatar;Level,membership_name;Email Address,user_email"]
[/membership]

Action and Filter Hooks

The following actions and filter hooks are available in this Add On:

do_action( 'pmpro_member_directory_before', $sqlQuery, $shortcode_atts );

Allows content to be inserted before the Member Directory content.

do_action( 'pmpro_member_directory_after', $sqlQuery, $shortcode_atts );

Allows content to be inserted after the Member Directory content.

do_action( 'pmpro_member_profile_before', $pu );

Allows content to be inserted before the Member Profile content.

do_action( 'pmpro_member_profile_after', $pu );

Allows content to be inserted after the Member Profile content.

apply_filters( 'pmpro_member_directory_display_name', $user->display_name, $user );

Modify the display name for members in your Member Directory and Member Profile.

apply_filters( 'pmpromd_user_identifier', 'slug' );

Filter to change how user identifiers are presented. Choose between slug and ID (case-sensitive).

apply_filters( 'pmpromd_profile_url', get_permalink( $pmpro_pages['profile'] ) );

Dynamically filter the profile URL. Use this filter to optionally link Directory entries to a specific Profile page per user ID or to an external URL.

apply_filters( 'pmpro_member_profile_elements', $elements_array, $pu );

Filter the elements array for the member profile.

apply_filters( 'pmpromd_member_profile_action_links', $pmpro_member_profile_action_links );

Filter which links are displayed on the single Member Directory Profile page.

apply_filters( 'pmpromd_get_display_value', $value, $element, $pu, $displayed_levels );

Filter the value of a specific element from a string of HTML.

apply_filters( 'pmpro_member_directory_sql_search_where', $sql_search_where, $s );

Allow filtering the member directory search SQL to be used.

apply_filters( 'pmpro_member_directory_sql_parts', $sql_parts, $levels, $s, $pn, $limit, $start, $end, $order_by, $order );

The $levels parameter is a single level ID or a comma-separate list of IDs (not an array of level IDs).

The $sql_parts parameter is an array of each section of the SQL query for building your list of members to include in the directory. The sections of the array you can modify include:

  • $sql_parts['SELECT']
  • $sql_parts['JOIN']
  • $sql_parts['WHERE']
  • $sql_parts['GROUP']
  • $sql_parts['ORDER']
  • $sql_parts['LIMIT']
apply_filters("pmpro_member_directory_sql", $sqlQuery, $levels, $s, $pn, $limit, $start, $end, $order_by, $order);

Allow filtering the final member directory SQL before users are queried.

apply_filters( 'pmpromd_user_directory_results', $theusers );

Filter the array of users returned from the query before display.

apply_filters( 'pmpro_member_directory_elements', $elements_array );

Filter the elements array for the member directory.

apply_filters( 'pmpro_member_directory_elements', $elements_array );

Filter the elements array for the member directory.

Screenshots

4 Column Layout

Screenshot of Directory example using the 4 column layout

Table Layout

Example of the directory using the table layout

Member Profile

Screenshot of member profile example

This is a Plus Add On.

Plus Add Ons are included in all Plus or higher premium membership plans.