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.