1. Documentation /
  2. Extensions /
  3. WooCommerce Memberships /
  4. Usage /
  5. WooCommerce Memberships Directory Shortcode

WooCommerce Memberships Directory Shortcode

Overview ↑ Back to top

WooCommerce Memberships includes a [wcm_directory] shortcode that lets you publicly display members on your site within a directory. By passing certain arguments into the shortcode, you can opt to show members of only certain plans or statuses, and this shortcode can be included in a restricted page as well to keep it private for members-only, if desired.

Using the directory block ↑ Back to top

You can add a membership directory to any page on your site using the Member Directory block.

  1. In the page editor, click + to open the block library.
  2. Find the Member Directory block in the Membership category.
  3. Select the block and configure directory settings:
    1. Choose which membership plans and statuses to include.
    2. Decide how many members are shown on each page of the directory.
    3. Show or hide the member avatar, bio, contact information, and custom profile fields.
  4. Using the directory shortcode ↑ Back to top

    To add the directory to a page, use the [wcm_directory] shortcode on any page or post where you want to output your listing of members. You can enter this shortcode within a Memberships block in the Gutenberg editor to easily restrict the directory within a public page, or restrict the entire page if desired.

    The shortcode will show a paginated list of members on your site. By default, all active members are included.

    Example of membership directory shortcode on frontend

    If you’d like to modify the directory output, you can add any of these attributes to the shortcode:

    Attribute Accepts Output Default
    plans comma-separated list of plan slugs or IDs changes which plans are included in the directory any
    status comma-separated list of membership statuses changes which status members must have to be included in the directory any
    per_page number determines number of members shown per page 12
    bios “yes” or “no” determines if member biographies are shown or not yes
    avatars “yes” or “no” determines if member avatars are shown or not yes
    avatar_size number size of avatars to show (in pixels) 128

    Putting it all together, you could use a shortcode like this…

    [wcm_directory plans="silver,gold" status="active,complimentary" per_page="24" bios="no" avatars="yes" avatar_size="90"]

    …to show users with active or complimentary memberships in the Silver or Gold membership plans. The directory will list 24 members per page, without biographies, and avatars at 90px each.

    Questions & support ↑ Back to top

    Have a question before you buy? Please fill out this pre-sales form.

    Already purchased and need some assistance or have a suggestion for how to improve the directory options? Please contact support via the help desk.

WooCommerce

The most customizable eCommerce platform for building your online business.

  • 30 day money back guarantee
  • Support teams across the world
  • Safe & Secure online payment