As a site owner, you might have come across specific customizations you need for your Paid Memberships Pro powered website. These customizations are usually found in a code recipe format from PMPro blog posts or provided by our Support Team. In this post, we will be showing you how to add code to a WordPress Membership site by using the Code Snippets Plugin.

How to add code to WordPress Code snipets plugin

Using the Code Snippets Add On

The Code Snippets plugin is available for free in the WordPress repository. It is an easy and simple way to implement and run PHP code snippets on your site. When using this plugin it removes the need to add custom snippets to your theme’s functions.php file.

Video Demo

10 Steps to Implement and Use the Code Snippets Add On:

  1. Navigate to your WordPress admin area > Add Plugin > Search, Install and activate the Code Snippets plugin.
  2. On the left-hand side of your WordPress admin area, look for Snippets, click on “Add New”.
  3. Under the “Add New Snippet” box, type in a title. Preferably a description about what the custom code will do on your website.
  4. Go to the code recipe you want to use, select and copy the code.
  5. Go back to “Snippets” in your WordPress admin area and in the “Code” section, write or paste in your custom code gist/recipe in that box.
  6. When pasting in your code, note the <?php tag is already added by default, do not add that line at the beginning of your code as it will trigger a fatal error.
  7. If there are any errors in your code such as a missing comma, the editor will indicate an ‘x’ sign in front of the line(s) of code with the error.
  8. By default, the “Run snippet everywhere” select box is checked, do not change that.
  9. Click on “Save Changes & Activate” to run your custom code recipe on your WordPress site.
  10. Go test or view the customization that you added to your WordPress site.

We are Here to Help

Adding customization to your WordPress membership site can at first feel overwhelming, especially for the entry-level WordPress user. Although the Code Snippet Plugin has made this transition easier we recognise some users need help to use and implement custom code to their sites.

If you are having trouble using the Code Snippets Plugin or getting errors in your code recipe, please reach out to our support team in the Member Support Area (available to premium memberships). Here you can receive hands-on guidance and help.

Another Way

The Paid Memberships Pro team also recommend an alternative method to add custom code by creating a Custom Plugin. You can read more on how to create a customization plugin here.