WP Simple Pay Documentation

Documentation, Reference Materials, and Tutorials for WP Simple Pay

How to Add Custom Code to WP Simple Pay

This article details adding custom code to your WordPress site and is intended for developers. Although we don’t provide custom development services ourselves, if you need help we highly recommend Codeable.

Custom code snippets are provided as-is and there is no guarantee they will continue to work across multiple versions of WP Simple Pay.

Do you need to add specific functionality to your WP Simple Pay payment forms not available in the plugin settings?

If you’re not an experienced WordPress developer but are somewhat comfortable with PHP or JavaScript code, copying and pasting code snippets is pretty straightforward.

Just make sure to back up your site first and test on a staging or local site first before making changes to your live site.

From there, simply follow the Beginner’s Guide to Pasting Snippets from the Web into WordPress from WPBeginner.

Using Our Code Snippet Library

We also have a code snippet library for WP Simple Pay. This library holds example code making use of various filter and action hooks available in the plugin.

We recommend using the free plugin WP Code when adding code from our snippet library.

To use one of our code snippets with WP Code, go to Code Snippets → +Add Snippet and select the Add Your Custom Code snippet.

When choosing a PHP Snippet code type, WP Code adds the opening <?php tag automatically. Please ensure that you do not inadvertently add a second.

Be sure to select the PHP Snippet Code Type, and to toggle your snippet to Active after you have made any necessary changes and are ready to make the code live. All other settings can remain at their defaults.

add custom code snippet wp code

Here are just a few of the code snippets available:

Browse the WP Simple Pay code snippet library on GitHub.

Contributing to the Code Snippet Library

If you’re a developer and want to contribute a code snippet, please open up a pull request on the GitHub repository.

Note, we do not recommend altering WP Simple Pay code directly, as it will be overwritten with any plugin update.

Is there a place in our code that we could add another hook that would be useful to you? Please let us know.

Still have questions? We’re here to help!

Last Modified:

Start Accepting Payments Today

Start accepting one-time and recurring payments or donations on your WordPress website.