This code recipe demonstrates how to add a new [pmpro_member_search] shortcode that searches members listed in your directory. You can build a directory and frontend profiles for your members using the Member Directory and Profile Pages Add On for Paid Memberships Pro.

Once the recipe is loaded in your site’s customizations, you can place the shortcode in any widget area or post. To protect member search by membership level, be sure to nest the shortcode within the Require Membership shortcode or block.

Member Directory Search Add to Site

The Code Recipe

Adding the Recipe to Your Website

You can add this recipe to your site by creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository. Read this companion article for step-by-step directions on either method.

Modify line 15 of the recipe with the full URL of the page that holds your member directory (the page defined on the Memberships > Settings > Pages screen in the WordPress admin).

To use the shortcode, add the following contents to a widget or block:

[pmpro_member_search]

You can nest that shortcode within the Require Membership block if you want to make the feature available to certain membership level users only.

Example of the Require Membership Block with Member Search Shortcode

Free Course: Membership Site Development—The Basics

Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.

Featured Image for Membership Site Development Course: The Basics
Was this article helpful?
YesNo