Gravity Forms has plenty of filters to customize your forms. We wrote very short articles in the past about filters we use a lot and decided to bring them all to this page for reference.
Capitalize fields in Gravity Forms
How to capitalize the content of a Gravity Forms input field? There are two possible angles. If you just want to display the content of a field in Uppercase, use the CSS. If you want to convert the user input to Uppercase while submitting the form, use the PHP solution.
Capitalize a form field with CSS for visual purpose
First you need the form ID and the field ID. Then add the following code to your CSS. Of course you need to change the Form and Field ID number. The correct CSS selector is ‘#input_FormID_FieldID’.
#input_6_1 { /*based on FormID and FieldID*/
text-transform: uppercase;
}
Capitalize a form field with PHP before entry
First you need the form ID and the field ID. Then add the following code to your functions.php. Of course you need to change the Form and Field ID number.
//Change _6 to the form ID number everywhere
add_action('gform_pre_submission_6', 'capitalize_fields_6');
function capitalize_fields_6($form){
// add all the field IDs you want to capitalize, to this array
$fields_to_cap = array('input_6_1');
foreach ($fields_to_cap as $each) {
// for each field, convert the submitted value to uppercase and assign back to the POST variable
// the rgpost function strips slashes
$_POST[$each] = strtoupper(rgpost($each));
}
// return the form, even though we did not modify it
return $form;
}
Change expiration date Save and continue Gravity Forms
Do you want to change the expiration date for Gravity Forms ‘Save and continue’ functionality (standard 30 days)? This is easily done by adding filter in the functions.php file in your theme folder.
How to change the expiration date in Gravity Forms Save and continue?
Just add the code below to the functions.php file in your theme folder. By changing the $expiration_days value you can set the number of days the form will be saved.
add_filter( 'gform_incomplete_submissions_expiration_days', 'gwp_days', 1, 10 );
function gwp_days( $expiration_days ) {
// change this value
$expiration_days = 365;
return $expiration_days;
}
Zip-code before City in Gravity Forms (order of address field)
Do you want to change the order of the Gravity Forms Address field items? Especially to put the ZIP-code before the City (as is usual in Germany and the Netherlands for example)? Here you find the easiest way.
How to change the ZIP-code field location in your Gravity Form
Copy this code in your functions.php in your theme directory and the zip-code will show before the City instead of after it.
add_filter( 'gform_address_display_format', 'address_format' );
function address_format( $format ) {
return 'zip_before_city';
}
Go to the top after Next or Submit Gravity Forms
When you use pages in your Gravity Forms (people click Next to go to the next page in the form) or when people submit their form, you may want to automatically have the page centred at the top of your website. This is very easy to do. It makes it much friendlier for visitors of your form, because they know that they start from the same point after clicking a button (Next or Submit).
How to create a top anchor in a multi page Gravity Form
Add the following code to your functions.php theme file. After people click Next or Submit, the page will be automatically outlined at the top of the page.
add_filter("gform_confirmation_anchor", create_function("","return 0;"));
WordPress Multi Site Gravity Forms License
If you use Gravity Forms in a Multi Site install of WordPress, and you create new sites,
you may want to add the Gravity Forms license key automatically to your new site.
How to automatically add Gravity Forms License key (and more) to multi-site installs
This is an easy way to prepopulate your Gravity Forms license key when new sites are created on a multi-site install. Add the following code to the wp-config.php file. More interesting multi-site automation options are described in de Gravity Forms documentation.
define("GF_LICENSE_KEY", "YOUR-LICENSE-KEY-HERE");
Our Premium add-ons for Gravity Forms
All Entries
All your new Gravity Forms entries in one central place. Stop navigating between multiple forms to find new entries. Get immediate oversight and full control with a powerful, unified dashboard.
List Text
Add features like textarea, placeholder and custom validation to a column or multiple columns in a Gravity Forms List Field.
Entry to Database
Integrates Gravity Forms with internal or external databases, offering flexible mapping of form fields to database columns and real-time synchronization between entries and database rows.
API Connector
Connect Gravity Forms to External API's: Query the API using form field values and automatically fill other form fields with the API response.
Read tutorials about
How to Create an Event Workshop Registration + Waitlist System in WordPress
This guide shows how to set up a workshop registration + waitlist system in WordPress: register attendees until capacity is reached, waitlist the rest, approve entries, and auto-promote people when a seat opens using Gravity Forms, Gravity Flow, and GravityView.
Gravity Flow Form Submission Step Tutorial
The Gravity Flow Form Submission step pauses a workflow until another form is submitted, then continues once the handoff is complete. This guide shows how to connect two forms, prefill fields with mapping, send the correct secure link, and troubleshoot the most common “workflow didn’t move” issues.
Gravity Flow Delete an Entry Step Tutorial
The Gravity Flow Delete Entry step lets you trash or permanently remove Gravity Forms entries as part of a workflow. This guide covers the key settings, scheduling options (delay or date-based), and safe testing tips so you can follow retention and privacy rules with confidence.
Gravity Flow Update Fields Step Tutorial
The Gravity Flow Update Fields step pulls values from another entry and writes them into the current entry, so your workflow can route using “live” data. This tutorial covers source form selection, entry lookup with filters and sorting, field mapping, and quick testing.