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.

Add Search Field

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

[pmpro_member_directory_search]

The search form sends visitors to the Directory page assigned in Memberships > Settings > Pages, where the matching members are shown.

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

Video: Coding with Sam Walkthrough

What the Search Matches

The directory search looks for the search term in these member values:

  • Names: The member’s display name, first name, and last name. These are always searched, even when they aren’t shown in the directory.
  • Fields Shown in the Directory: Any user field, user meta field, or User Field that your directory displays, such as user_login, user_email, user_url, or a custom field. Fields that aren’t shown aren’t searched. For example, the search only matches email addresses when your directory displays the member’s email address.
  • Mailing Address: If your directory shows the pmpro_mailing_address element, the search also looks in the member’s mailing address fields.

User Fields that are limited to certain membership levels only match members who have one of those levels. This is the same rule the directory uses to decide whether to display the field.

Search terms are matched as plain text. Characters like % and _ are not treated as wildcards.

Screenshot of Member Directory search results for the name Sofia in a three column layout

Developers can change which user meta the search looks in with the pmpro_member_directory_search_meta_keys filter.

Troubleshooting Search Results

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.

Last updated on November 12, 2026


Was this article helpful?
YesNo