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 two methods for adding custom code to adjust your membership site functionality: creating a custom plugin or using the Code Snippets plugin available for free in the WordPress repository.

Banner Image for How to Make Customizations to Your Membership Site

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 or the Code Snippets interface helps your developers and our support team know exactly WHERE the custom code is located as it relates to your Paid Memberships Pro setup.

How to Copy and Paste Custom PHP Recipes

Before you begin using a custom recipe, please read through our documentation on how to safely copy and paste PHP recipes. This guide on how to copy and paste custom PHP recipes is useful for beginner to intermediate level WordPress users who may not be very familiar with PHP and code.

Method 1: Create a Plugin for PMPro Customizations

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.
  • If you don’t know how to use FTP, read this guide on the WordPress Support page about FTP clients. You can also refer to your web host’s FAQs and guides.
  • 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

Then, create your customizations plugin.

  • Option 1: Download a Blank Customizations Plugin
  • Option 2: Create a Customizations Plugin
    • Create a folder called pmpro-customizations in the wp-content/plugins folder of your site.
    • Create a file called pmpro-customizations.php in the folder you just created.
    • Edit the pmpro-customizations.php file and paste this block of code into the file.
    • Save the file.
    • Upload the plugin via FTP to your website.

Finally, activate the plugin via the Plugins page of your WordPress admin.

The video below demonstrates how to follow these steps to create a plugin for customizations to your WordPress membership site.

How to Edit 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.

Method 2: Use the Code Snippets Plugin

Code Snippets by Shea Bunge is available for free download in the WordPress.org plugin repository. This plugin provides a simple way to run PHP code snippets (or what we call “recipes”) on your site. It removes the need to add custom snippets to your theme theme’s functions.php file or use a separate plugin for PMPro Customizations.

Download Code Snippets via WordPress.org

How to Add Globals or Constants in wp-config.php

Some of our Add Ons accept constants or globals defined in your WordPress site’s wp-config.php file. This file is found in the root folder of your WordPress site.

The default wp-config file contains loads of critical information for your WordPress site. To be safe, place new constants immediately below the WP_DEBUG constant.

Add each constant on a new line and end each line with a semicolon. For example:

define( 'PMPROIO_CODES', 1 );

How to fix things if customizations break your site.

We understand that you may not be completely comfortable working “in the code”. 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.

Customize the Appearance (CSS/stylesheet)

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

Was this article helpful?
YesNo