Adding custom code

Several Quform guides ask you to add a small piece of PHP code to your site. This page explains three ways to do that, in order from easiest to most advanced. Pick whichever you’re most comfortable with. The result is the same.

1. Use a code snippets plugin (recommended)

This is the easiest and safest option for most users. A code snippets plugin lets you add PHP snippets through the WordPress admin without editing any files. Your snippets are kept separate from your theme, so they aren’t lost when you switch or update themes, and you can toggle each one on or off.

Most snippet plugins also include error protection that automatically deactivates a snippet if it would otherwise break your site, which makes them much safer than editing files directly.

Two popular free options:

WPCode – Insert Headers and Footers + Custom Code Snippets – WordPress Code Manager

Code Snippets

To add a snippet:

  1. Install and activate one of the plugins above.
  2. Open its menu in your WordPress admin and add a new snippet.
  3. Set the snippet type to PHP.
  4. Paste in the code from the Quform guide.
  5. Save and activate the snippet.

2. Add the code to your theme’s functions.php file

If you’re comfortable editing theme files, you can paste the code into your theme’s functions.php file.

Important: use a child theme, otherwise your changes will be lost the next time the theme is updated.

  1. In your WordPress admin, go to Appearance → Theme File Editor, or edit the file via FTP or your hosting file manager.
  2. Open functions.php in your child theme.
  3. Paste the code from the Quform guide at the end of the file.
  4. Save the file.

3. Create a custom plugin (advanced)

If you have a lot of custom code, or you want it to stay active regardless of which theme you’re using, you can put your snippets into a small custom plugin. See Creating a plugin for custom code for instructions.

Be inspired. © 2026 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy