Hi,
I used the PHP code below to change all field labels from “price” to “tuition”. Now I have a new form where I need this field label to be “price” – without affecting the other forms. How do I do that? Thanks in advance!
add_filter( 'gform_product_price', function ( $sublabel, $form_id ) {
GFCommon::log_debug( __METHOD__ . '(): Running...' );
return 'Tuition';
}, 10, 2 );
david
(David (Gravity Wiz))
October 16, 2026, 10:49am
2
You can use the $form_id parameter available in this filter to exclude your new form from the label change.
Just replace your existing snippet with this:
add_filter( 'gform_product_price', function( $sublabel, $form_id ) {
// Keep the default "Price" label for form 123.
if ( $form_id === 123 ) {
return $sublabel;
}
return 'Tuition';
}, 10, 2 );
Replace 123 with the ID of your new form.
This will continue changing “Price” to “Tuition” on all your other forms while leaving the default “Price” label intact on your new form.
If you need to exclude additional forms later, you can easily expand this to support multiple form IDs.