Removing the Gravity Forms submit button

So you're creating a really cool form with Gravity Forms, maybe you're using Number fields to create a calculator, but you've hit a snag. All forms created using Gravity Forms have a submit button, and your awesome calculator doesn't need one, what are you going to do?

Well you could hide the button using CSS, the following when added to your theme stylesheet or wherever you add custom CSS would hide the footer therefore hiding the submit button.

.gform_wrapper .gform_footer {
    display: none;

The above example would affect all forms so if you only want to target a specific form you would switch from using the form wrapper class selector to using the form wrapper ID like so:

#gform_wrapper_10 .gform_footer {
    display: none;

Another way would be to hide it using conditional logic, you would do this by editing the form settings and configuring a condition for the form button that you know can never be met therefore your submit button will never be shown.

The above methods are fine but the submit button is still there, what if there was a way to actually remove the button, good news, there is. Gravity Forms has many hooks you can use, in this case gform_submit_button is the hook Gravity Forms provides so you can change the submit button, the example in the documentation shows how you can replace the <input> element with a <button> element.

But how do you use that hook to remove the submit button, well it's easier than you'd think, WordPress has a couple of readymade functions you can call on, so instead of using a custom function you can call on the WordPress __return_false function, by returning false to gform_submit_button no button will be included with the form.

The example below will remove the submit button from the form with the id 10

add_filter( 'gform_submit_button_10', '__return_false' );

To remove the submit button from all forms, simply remove the form id from the end of the hook name like so

add_filter( 'gform_submit_button', '__return_false' );

So one line of code added to your theme's functions.php file or custom functionality plugin and say goodbye to the submit button. How easy is that!

Back To Top