How do I install a snippet?

There are three methods for installing snippets.

  1. Quick and Dirty

    Copy the “raw” version of the snippet to your theme’s functions.php file. Make sure to exclude the opening <?php line.

  2. Less Quick but Better

    Use a snippet management plugin (like Code Snippets) to install and manage the snippet.

  3. Developer-friendly

    Create a simple, site-specific plugin for the snippet(s). Full walk-through here.

FAQs

How do I add more than one class-based snippet to the same form or multiple forms?

Adding multiple instances is easy once you know how to conjure the right magic. Check out our tutorial on how to do just that.

Why doesn’t this snippet work?

If you run into any issues installing a snippet, make sure to check out our Snippet Troubleshooting Guide.

Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.