As a site owner, you might have come across specific customizations you need for your Paid Memberships Pro powered website. In this guide, we show you how to add code to your WordPress site right in your site admin.

How to Add Code to WordPress Using the Code Snippet Plugin Banner Image

Using the Code Snippets Plugin

The Code Snippets Plugin is available for free in the WordPress repository. The plugin provides a simple admin interface to add PHP, CSS, and JavaScript code to your WordPress site. When using this plugin, you won’t need to add customizations plugin or make any edits to your child theme’s functions.php file.

If you would prefer to add your custom code via a plugin file, check out this alternative method on how to create a customization plugin.

Video Demo: Add Code to WordPress

10 Steps to Use the Code Snippets Plugin:

  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’re Here to Help With Custom Code

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.

Cover image from ebook 29 Nuggets of Wisdom Volume 1 - Sample Collection

Download the free ebook: Get 29 insights and ‘aha moments’ for new or veteran membership site business owners. Use these nuggets of wisdom to inspire or challenge you.

Was this article helpful?
YesNo