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 Seahawk Media.
Custom code snippets are provided as-is, and there is no guarantee they will continue working across multiple WP Simple Pay versions.
Do you need to add specific functionality to your WP Simple Pay payment forms that are unavailable in the plugin settings?
If you’re not an experienced WordPress developer but somewhat comfortable with PHP or JavaScript, 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 before changing your live site.
From there, 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 using 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 automatically adds the opening <?php tag. Please ensure that you do not inadvertently add a second.
Be sure to select the PHP Snippet Code Type and 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.

Here are just a few of the code snippets available:
- Conditionally dequeue plugin scripts and styles.
- Create a new WordPress user using the email address of one-time or subscription charges.
- Change the custom amount field to “number” type to show the decimal key on iOS & mobile browsers.
Still have questions? We're here to help!
Last Modified: