Include the used and claimed Group Discount Codes in your Membership Orders export file

This recipe was so useful that we merged it into the Group Discount Codes Add On. When the Add On is activated, a “Group Code” column is added to the CSV export showing the Group Code that was used at checkout (if applicable). The regular Discount Code column will show the main/parent discount code.

You can grab the Group Discount Codes Add On that includes this feature here. If you are interested in how this works to possibly do something similar via custom code, we’ve kept the original code recipe here for reference.


About the Code Recipe

The Group Discount Codes Add On for Paid Memberships Pro allows you to see the number of times the ‘parent’ discount code was used on the Memberships > Discount Codes admin page. However, you might want to know which individual ‘child’ group discount codes have been used and by whom.

If you’re new to the Group Discount Codes Add On, it adds features to PMPro to better manage large numbers of unique discount codes with the same pricing. For example, it can be used to create a group of codes to print on promotional material, for use in a campaign with Groupon or for an email campaign.

You can use the following code recipe to add an extra CSV column called group_code to your Orders CSV download file. Inside of this new column, you will be able to see which individual group codes have been used and by which member. To access and download your Orders CSV file, navigate to your WordPress Dashboard > Memberships > Orders > Export to CSV.

We are currently working on better reports for Discount Codes in the core Paid Memberships Pro plugin as well as specialized reports for viewing activity on your Group Discount Codes. This code recipe will help membership sites already using the Group Discount Codes Add On to have better visibility of code uses. is already merged into the Add On, but you can view the code recipe below for reference. Let us know if you have any other ideas for this Add On or discount codes in general.


The Code Recipe

This code recipe requires a Plus Account or higher.

View Membership Options

Add a customized notification banner to alert your members of upcoming expiration.

This code recipe adds a notification banner to remind members that their account will expire within 7 days—or any custom timeframe you would like. You can use the recipes with any WordPress theme, or specifically with a membership site using Memberlite.


About the Code Recipe

By default, Paid Memberships Pro will send members an expiration email notice 7 days prior to their expiration date (by the way, if you want to add more email expiration warnings, see our Extra Expiration Warning Emails Add On).

This recipe adds an expiration warning directly on your site, reminding the logged in member that they must renew to maintain access. The banner will only be shown to a member that has an active membership level with an expiration date within the next 7 days. You won’t need to rely on email delivery, receipt, or that your member will actually read the message.

If a member decides to renew their membership by clicking the “Click here to renew membership” link, they will be redirected to the membership levels page. From here they can select their desired membership level and proceed to checkout. They will no longer see the message


This code recipe requires a Plus Account or higher.

View Membership Options

Create a Robust Directory and Individual Profiles for Your WordPress Membership Site

An important feature for many membership sites is the ability to display a dynamic directory of members and profile pages. Here is some information on how to add and customize these features using the Member Directory and Profile Pages Add On for Paid Memberships Pro.


Before you get started, consider this.

While a directory may be a desirable feature of membership, it is important to make it clear to your members what information will be made public or displayed privately. You can communicate what information will be shown, and what other members are allowed to do with that information via a Terms of Service agreement or elsewhere on your site.

Some points to include in this message would be:

  1. Can members directly contact another member via email?
  2. Can members copy the list of all members and send them mass email?
  3. Can a member opt to exclude themselves from the directory or just hide specific information?
  4. What are the consequences for abusing your policy?

Creating the Directory and Profiles

The Add On page covers primary documentation for the Member Directory and Profile Pages plugin. This includes the basic steps of generating the pages under Memberships > Page Settings and customizing the shortcode to display your unique fields.

Below are a few recipes, tips and tricks to make your directory even more robust.

  1. Capturing Additional Member Fields

    Our Register Helper Add On allows you to add new profile fields at membership checkout. This is a key plugin used by most membership sites that have unique fields based on the topic of their membership site. Some examples may include a file upload, such as a restaurant menu or resume, or business categories, such as “Small Business” or “Non-Profit”.

  2. Hide or Show Fields on Member Profiles based on Membership Level

    For many membership sites, a feature of higher-tier membership is the additional of more profile fields on the member directory, perhaps three videos or audio embeds, additional logos or photographs of a business location, or expanded contact information (website, phone, email). This can be achieved via the code recipe outlined in the link above.

  3. Allow Members to Upload an Avatar or “Logo”

    If you are planning to include images in your directory, this post outlines some recommended plugins for user avatar management on your WordPress site.

  4. Capturing Default WordPress Profiles Fields for your Directory

    The WordPress User profile already includes some key fields you may want to leverage for your membership site, such as “Site URL”, and “Description” (or biographical info). This post covers how to capture those fields for display on user profiles.

  5. Frontend Profile Field Management

    While we may eventually role this into the Add On, we recommend using the “Themes Profiles” module of the Theme My Login plugin to allow members to edit their profile fields in the frontend theme of your WordPress membership site. View the plugin in the WordPress.org repository »


Who can see the member directory and profiles?

There are a few methods to control the directory and profile visibility. It may take a little creative thinking to wrap your brain around the examples below, so please open a topic on the members forum and we will be happy to help you achieve your goals.

  1. Using the Page’s “Require Membership” Settings

    Set Membership Restrictions for a Page If your directory is visible to members only, you can control the content access to the page you place the directory shortcode on just like you do any other piece of member content. Simply edit the directory or profile page and check the appropriate level(s) in the “Require Membership” meta box.

  2. Using the [membership] Shortcode

    You can duplicate the directory or profile page shortcode and wrap it within the [membership] shortcode to show a unique member directory by level, this can take many shapes, such as Level 1 Members only being able to see other Level 1 Members, or Level 2 Members not being able to see full member email addresses, while Level 1 members cannot view this information.

    Here is an example of this method:

    [membership level="1"]
    [pmpro_member_directory levels="1"]
    [/membership]
     
    [membership level="2"]
    [pmpro_member_directory levels="2"]
    [/membership]

Want a better search, category filters or sorting?

We’re always working to example the features of this and all of our Add Ons. So if the unique directory options you need aren’t covered by the tips above, please post a comment below or open a topic on the member’s forum.

Create a Plugin for Customizations to Your Membership Site

Many of our articles and code recipes include instructions on how to “customize and add this code to a plugin for customizations”. In addition, our support team may provide you with customizations to add to your site via this method.

This tutorial explains how to create and edit a custom plugin for all of your tweaks to the core plugin and for any Add Ons you are using.


But can’t I just edit my theme?

We strongly recommend using the customization plugin method for a variety of reasons. To be clear, the file functions.php within any theme or child theme performs like a plugin in that it can execute php code. While adding code to your active theme’s functions.php file is often quicker than building a plugin, the downside is that if you change or update your theme, you’ll lose the functionality that was built into that theme. Code in a plugin will persist.

In addition, the use of a customizations plugin helps your developers and our support team know exactly WHERE the custom code is located as it relates to your Paid Memberships Pro setup.


First, figure out how to FTP into your Website

While many of our add ons can be installed directly via your WordPress Dashboard, the customizations plugin is one instance where knowing how to use FTP to “put” or “edit” files on your web server is very important.

Your web host should have provided you with FTP or SFTP credentials. To properly log in to your web server you will need the:

  • FTP (or SFTP) address
  • Username
  • Password
  • (possibly) a port number and root directory

If you don’t know how to use FTP, this guide on the WordPress Codex provides some background on FTP and options for FTP clients, you can also refer to your web host’s FAQs and guides.


Creating Your Customizations Plugin


  1. Download the blank customizations plugin (.zip)
  2. Upload the .zip file via the Plugins > Add New > Upload page in your WordPress admin.
  3. Activate the plugin.

  1. Create a folder called pmpro-customizations in the wp-content/plugins folder of your site.
  2. Create a file called pmpro-customizations.php in the folder you just created.
  3. Edit the pmpro-customizations.php file and paste this block of code into the file:
  4. Save the file.
  5. Upload the plugin via FTP to your website.
  6. Activate the plugin via the Plugins page of your WordPress Admin.


Editing Your Customizations Plugin

  1. Connect to your web server via FTP.
  2. Navigate to the /wp-content/plugins/pmpro-customizations/ folder.
  3. Download the latest copy of the pmpro-customizations.php file.
  4. Open the file in your preferred editor.
  5. Add the code for the recipe or code shared via your support forum thread at the bottom of pmpro-customizations.php.
  6. Save the File and upload the folder and file to your website via FTP.

This Makes Me Nervous.

We understand that you may not be completely comfortable working “in the code”. Our support team can put minor code tweaks in place for you if you share FTP information in a private thread.

If you are updating the customizations on your own and an update to the customizations plugin completely breaks your site, don’t fret.

These steps should repair your site:

  1. Connect to your website via FTP and navigate to the wp-content/plugins folder.
  2. Rename the folder pmpro-customizations to anything else (I generally rename it to pmpro-customizations-off.
  3. Now, visit your site. WordPress will automatically deactivate the plugin and, in doing do, your site should be restored.
  4. You can then repair any broken code in the file and rename the folder to the original pmpro-customizations.
  5. Upload the updated file and reactivate the plugin via the ‘Plugins’ dashboard page.

Need to customize the appearance (CSS/stylesheet) of Paid Memberships Pro?

We have a separate guide that covers setting up CSS stylesheet for customizations to your Paid Memberships Pro-powered membership site.

View the PMPro Customizations Stylesheet Tutorial
 

Enqueue a Customizations Stylesheet in Your PMPro Customizations Plugin

If you would like to add unique CSS/styles to your site running Paid Memberships Pro, here’s a tutorial that extends our article on creating a plugin for PMPro Customizations.

This page requires a PMPro Core Account or higher.

Already have an account? Login Now »

New to this site? Register Now »