50+ Gravity Form Hacks, Plugins, and Code Snippets

Gravity Forms is pretty much the de facto standard for form development inside of WordPress. The first thing that comes to mind is the standard “contact form” (which it’s very, very good at), but the Gravity Forms plugin can do so much more.

I have a developers license for GF, and it’s one of the first plugins I install in any website I build. I am always amazed by how much you can do with it, how many features are built in – and how easy it is to do a lot of things (that used to take much longer). Let me take you through what I’ve learned over the last few years using the plugin.

You can skip this part if you already have the plugin, but if you’re new – let me outline the reasons Gravity Forms is pretty much the de-facto forms standard within WordPress, and why using a free contact form plugin just really isn’t good enough anymore (if you build websites for clients or yourself):

  • Entries saved in database: Most contact form plugins don’t store the entries in the db. If the email is lost, the entry is lost. To save entries in Contact Form 7, for example – you have to install an additional plugin. In Gravity Forms all entries are automatically saved in the database.
  • Import and Export forms: You can easily import and export any or all forms from one website to another. With a third party plugin (later in this article), you can even export and import the entries as well
  • CAPTCHA: The plugin has built-in support for the re-captcha service by Google. You can, however, use other captcha services using add-on plugins (see below)
  • Support: This is a very mature, robust, and well supported plugin with a moderated community and staff
  • Advanced fields and auto-population: Below, in the first section you’ll see that there are some advanced fields and auto-population or bulk add options that the free plugins just don’t have (or don’t do well).

Now, I’m going to take you through some features (you might not have known were there all along), some third party Gravity Forms plugins, and finally some PHP code snippets and hacks.

Gravity Forms Built in Features

Here are some features of Gravity Forms you may not have known existed (if you haven’t used them). You might have already come across them, but I seemed to find them one by one over time (as I needed the features).

Adding straight HTML to Forms

This is much easier than you think. Just add the Standard Field “HTML”, and you can then add HTML into your form like this:

add-html-block-gravity-forms

Conditional Form Fields

Let’s say you want to make a fields “conditional”. You ask a question and if they say “yes” you show an additional question, but if they say “no” you don’t.

gravity-forms-conditional-fields

Just edit the form field you want to be conditional – and then click the “advanced” tab. Check the “Enable Conditional Logic” checkbox, and choose the question that makes this fields conditional – and what the value should be to make it appear like this:

gravity-form-conditional-question

Conditional Form Recipients

You can even have “conditional recipients” for a gravity form. Like the image below, send email to one person, or department if a certain conditional is met, and others for other conditions. This is great if you have a form with choices for “sales”, “service”, “support”, etc.

gravity-forms-conditional-recipients2

Creating Columns in a Form

You may not know this, but it’s very easy to create columns for multiple input fields in the same section of a Gravity Form. For instance, let’s say you have 20 check-boxes, but it’s just one big vertical section. Wouldn’t that look better as 2 or 3 columns? What if you have city, state, and zip code – and what those all on the same line? Just refer to the Gravity Forms CSS Ready Classes page.

Then, add the class you want in the Advanced tab of a GF form field under “CSS Class Name” – as in this image:

readyclass_admin_input

If you don’t want to have refer to that page every time to figure out which CSS class to use, just install theGravity Forms CSS Ready Class Selector plugin. It adds a button to the right of the CSS class name field – to add what you need – like this:

css-class-selector

You get a really cool popup which makes it very easy to add the CSS class you want:

gravity-form-css-class-selector

Gravity Forms Third Party Plugins

You might already have a few of these Gravity Forms add-on plugins installed, but I guarantee that you don’t have them all (and probably didn’t know half of them existed). You’ll get some great new ideas once you browse through these!

Plugins that Add Features to Gravity Forms Itself

Gravity Forms Toolbar: this is one of the coolest plugins I’ve seen in awhile. It adds some content to your admin toolbar that takes you right to “entries”, or “add new form”, but it also adds links on the backend that lead right to forums, support, help-docs, etc.

Here’s a peek at the backend time-saving links:

gravity-forms-toolbar

Gravity Forms Terms of Service Field: Plugin does just what it says, adds a terms of service fields to your form. Doesn’t allow people to submit unless they click the terms of service (first). If you’ve ever had to code this by hand (like me) – you know how much time this plugin saves.

Gravity Forms – Placeholders: adds HTML placeholder support for GF form fields – and you get JS fallback.

Gravity Forms Popup Widget: rather than embed your Gravity form into the content of the page or a widget, have you ever wanted it to be in a popup or modal window? This plugin takes care of that, and even allows for an intro page before the form is shown – perfect!

Form Lightbox: is a plugin that allows you to put a gravity form inside a popup lightbox (so it doesn’t have to be embedded in the page content).

Gravity Forms PDF: ever thought it was a pain to view your Gravity Form entries, or thought downloading them to Excel was a pain? With this plugin you can just export them to a nice little PDF file. This plugin is the original.

Gravity Forms PDF Extended is a fork of that plugin – which claims to have better rendering capability. It can do a bit more too, like created a PDF of a form submission (that you can use in a notification), and it has the ability to create PDF template. You can view and download the PDF files in admin, and you can even output the PDF to a template or plugin.

Gravity Forms Data Persistence Add-On: by default is a visitor abandons a gravity form – when they come back they have to fill it out all over again. With this add-on for GF installed, they will be able to pick up again where they left off (if you have multi-page or multi-step forms).

Gravity Forms – Clockwork SMS: is an add-on that sends out SMS text message notifictions when a form is submitted, using the Clockwork API.

Gravity Forms CustomCaptcha: gives you an alternative to reCaptcha – uses the Securimage PHP Captcha system instead.

Are You a Human Free Captcha Alternative: is another captcha alternative (to reCaptcha) add-on for Gravity Forms.

SpamCaptcher: is a captcha alternative as well, it uses a TrustMe account.

WP Email Template: works with Gravity Forms, as well as anything that sends email from your website. GF already has an email template, but using this plugin you can make all outgoing emails from any plugin or WordPress itself – have the exact same template.

Pronamic Events is a plugin that allows you to add events capability to your WP website, but it works with both Gravity Forms and Gravity Forms + Custom Post Types.

infoGeniuz Advanced Form Analytics for Gravity Forms: adds some additional stats to your gravity forms, such as geo-location, number of visits and page-view, and browser data.

Gravity Forms RSS: is an add-on that allows you to read form entries as an RSS feed. Yes, it’s secure – the RSS feed isn’t public (without the token).

Misamee Gravity Forms Tools is a plugin that adds a few additional features to your Gravity Forms. Such as the ability to total fields entered (and provide sum), or a progress bar, to show how much of the form is filled out.

Gravity Meta is a unique plugin that allows you to add some custom URL parameters to gravity forms as hidden custom fields. This way you can add some tracking to your forms (with an alternative to custom JavaSript).

Google Analytics Tracking for Forms is an add-on plugin that allows you to track your form actions with GA. Normally to get this done – you’d have to custom write a little bit of JavaScript – this plugin takes care of all of that (it even does a little more).

Gravity Forms Dropbox Uploader: if you have a Gravity Form that has an attachment field – this add-on plugin offloads the attachments to a Dropbox account (awesome!).

Gravity Forms Importers

Where there’s another plugin with data, there’s a way to import that data into your GF installation.

Contact Form 7 Gravity Forms Importer: converting Contact 7 forms into Gravity Forms couldn’t be easier.

Gravity Forms API or Service Based Plugins

There are a lot of third party and add-on plugins for Gravity Forms that allow you connect with and / or submit form data to an external service (usually through an API).

Gravity Forms Highrise Add-On: submits content to the Highrise online CRM solution

Gravity Forms YMLP add-on: is an add-on for the YMLP (Your Mailing List Provider) mailing list service.

Gravity Forms Constant Contact Add-on: submits gravity form content to Constant Contact.

Gravity Forms ExactTarget Add-on: submits content to the Exact Target email marketing service.

Gravity Forms Mad Mimi: Submits gravity forms content to Mad Mimi email marketing service.

Gravity Forms ShootQ add-on: connects a gravity form to the ShootQ service (for photographers), that manages prints and photos.

Gravity Forms Subscriptions allows you to switch between one-time payments or subscriptions if you’re using Gravity Forms for payments.

Gravity Forms Stripe Add-On: allows you to accept payments using Stripe through a Gravity Form.

Gravity Forms Infusionsoft is an add-on that allows you to submit to your Infusionsoft CRM account from a gravity form.

Gravity Forms iContact Add-On: allows you to send Gravity Forms submissions to iContact (email marketing service).

Gravity Forms HubSpot Add-On: submits gravity forms data to the HubSpot lead API for inclusion in your account

Gravity Forms Fat Zebra: is an add-on that allows you to take payments (through a gravity form) using the Fat Zebra payment gateway (Australian).

Gravity Forms Sugar Event Calendar: an add-on that gives you integration with your Sugar Event Calendar (even registration service).

Gravity Forms eWAY submission: earlier this year I heard of eWAY for the first time, which is an online payment solution. It’s a very popular credit card payment gateway, and a LOT of non-profits and organizations use it for donations and payments. Now accepting those payments is as simple as created a gravity form.

Gravity to Solve360: allows you to export data from Gravity Forms to a Solve360 account (could based CRM solution).

Gravity Forms CapsuleCRM Add-On allows you to populate your CapsuleCRM account with gravity forms submissions.

Gravity Forms Submitting Content to WordPress (Posts, Plugins, or Themes)

Gravity Forms Directory

Gravity Forms + Custom Post Types: nice add-on plugin for GF that allows you to take a form submission and create a post inside WordPress and map it as a custom post type. Supports taxonomies, and has a nice UI.

Gravity Forms WYSIWYG is a plugin that allows you to put an advanced (TinyMCE) editor in place of an input field. I put this add-on plugin in the submitting content to WordPress section, because you would most likely want this kind of formatting and layout ability for using a GF to submit content to WordPress (or somewhere that needed HTML, etc.)

OptionTree Extension: Gravity Forms is a plugin that allows you to select a Gravity From from within OptionTree settings. OptionTree is used by a lot of premium theme authors for WP theme admin.

Headway Leaf: Gravity Forms Leaf is a plugin that allows you to use a Gravity Form within a Headway leaf (in the content, sidebar, etc.). Headway is a very popular drag and drop theme building framework.

Gravity Forms – Update Post: allows you to update or delete posts, pages, or custom post types using a Gravity Form. It does repect user capabilities – there’s a lot of things you could do with this.

Gravity Forms Hacks and Code Snippets

If you’re a coder, there are some cool Gravity forms things you can do with just a little PHP or JavaScript. Even if you’re not a coder, a little copy and paste goes a long way.

I tend to collect as many GF snippets of code as I can, and I frequent Gravity Wiz quite a bit as well. Here’s snippets I use from that site frequently:

Shortcode to display number of entries left: some code to display on a page how many entries are left (if you’ve set a limit).

Random Fields with Gravity Forms: allows you to randomize the fields shown on a Gravity Form.

Limiting How Many Checkboxes can be Checked: does just what it says (in a GF form).

Limit IP to One Submission per Time Period: same thing – handy if you’re running a contest or form that people shouldn’t be filling out multiple times.

Here are some of the best Gravity Forms code snippets I’ve found in other places (and use a lot):

Edit User Profile with Gravity Form: this works well – and gives you screenshots as well as complete code for setting up the actions and functions.

Gravity Forms Code Collection: great deal of posts tagged “gravity forms” with code for adding a button class, adding a class to the GF submit button, form validation hook, using a gravity form outside of WordPress, changing the upload path, attaching files, custom field filters, taxonomy fix, and more.

Gravity Forms Snippet: hide fields: this is a great snippet for hiding specific fields from logged in and / or logged out users.

Insert Gravity Form Data into New Table: awesome snippet that takes gravity forms data and submits it to another MySQL db table using an action.

Trigger jQuery when Gravity Forms input button is clicked: helpful piece of code, if you’ve ever had to do this and not had success.

I hope you find this as a helpful resource. Be sure to bookmark this page for future reference. As always please post any comments below.

Link: Gravity Forms

This article was authored by:

John Pratt is principal WordPress developer at JTPratt Media, where you can find him working on custom themes and plugins for small business and corporate clients.

John Pratt has authored 12 posts.Visit Website

Showing 29 Comments

  • Excellent round-up, John! Keep up the great work!

    REPLY
  • Thanks for this. I’ve been using Gravity Forms for a long time – the developer’s license was probably one of my best investments – but you’ve just helped me learn more cool uses.

    REPLY
  • Janet Hall (OverHall)

    Excellent “all in one place” Gravity Forms add on’s. I’m so glad I found this and have added it to my favorites.

    REPLY
  • VegasKev

    You are a gentleman and a scholar for this one. You were right in your initial opening of the post…there were definitely a few useful add-ons for GF that I wasn’t aware of. Lots of time saving snippets as well.

    Much appreciated!

    REPLY
  • Hi, your post is great, but there is one thing i want to ask about, and i think a lot of readers will be interested as well. In your example about condition logic, you said that when people click on “Yes” it gonna show them question, but after they clicked yes, they click to “No” that question won’t go away :( How did you resolve that problem?

    REPLY
  • I am using Gravity Forms. It is a great plugin for creating WordPress Form. Your blog is wonderful. There is many tips I read.

    REPLY
  • Thank you

    REPLY
  • Thank you John for the resource. So many new add-ons for Gravity Forms I had no clue about. Actually, one of the conditional logic uses would have saved us a couple hundred in dev costs had I found this post a weekago. shhh… dont tell my boss lol… thx again, you rock!

    REPLY
  • excelent post. thank you.

    REPLY
  • Great list of resources. Hadn’t heard of most of these. Thanks!

    REPLY
  • Hi

    I just wanted to know if anyone knew how to input help text when they click on a “?” next to the field as the description showing all the time makes the form look messier?

    Anyone have any ideas?

    Thanks

    REPLY
  • great work, I used to. thanks.

    REPLY
  • you answered my questions. thank you bro.

    REPLY
  • Great post – I have been using gravity Forms for about a year and I really like it. I have had some success with the Paypal add ons and I just installed the Salesforce add ons. Thanks again for the info!

    REPLY
  • Paypal add ons and I just installed the

    Regards Web Administrator.

    REPLY
  • I want to know something that I didn’t see in the post (Which is a really great post), I a visitor send a form for a specific user is it possible that when the user logs-in, he can see a page with a table to display the info for that specific user and also to send an email with that info too?

    REPLY
  • Gravity form is the best ever seen. I have use this form. Thanks

    REPLY
  • Hi Admin,
    Gravity form is the best ever seen. In our development, we are using it and good experience with gravity form.

    Nice & Cheers!!

    REPLY
  • This is very useful, thank you. Excuse me if this is a basic question. Can I take data fields captured in a gravity form (name, tel no, address, etc..)and auto populate it into the WP-CRM system from Usability Dynamics?

    REPLY
  • Hello John,
    Thanks for all the info! I have one question:
    Is there a possibility to automatically export the data to another sql or ftp server without manually downloading csv. Files?
    Kind regards,

    Gerrit Vermeulen

    REPLY
  • Please help me
    please can you explain how to integrate gravity form with diffrent payment methos like Postfinance etc. other than paypal and all default.

    Thanks

    REPLY
  • Hi there,

    Not sure if you’re interested in our new Gravity Forms plugin: Gravity Forms + DigitalOcean.

    It integrates DigitalOcean cloud hosting with Gravity Forms so that with a (free) DigitalOcean account and Gravity Forms, you can become a host!

    Willing to offer a free copy if you’d like to review it.

    Thanks,

    REPLY
  • Hi Admin,
    In the WordPress, Gravity form is the popular for the contact us form.

    Thanks for the sharing!

    AumInfoTech Team

    REPLY
  • Brilliant Piece

    REPLY
  • Insta-favourite!

    REPLY
  • Gravity Forms Terms of Service Field link is dead???

    REPLY
  • Michael Scott (Admin)

    It looks like they killed that one:(

    REPLY
  • Do you know if there is any way to add a Social Media choice field – where a user can choose twitter, facebook, etc. and then add their user name?

    REPLY
  • Is there any kind of plugin or add on where a user could choose a social media platform (twitter, facebook, linkedin, etc.) and add their username? One that would show the icons?

    REPLY

Add Your Voice: