Handy Code Snippets for Gravity Forms on your Child Site


Gravity Forms is a solid, easy-to-use form plugin which has a number of add-ons and free plugins.

Gravity Forms has a number of filters, actions, and hooks which allow you to modify most parts, using code snippets. MainWP has an easy-to-use extension for code snippets, so you can save a code snippet to any connected child site.

The first of the useful code snippets for Gravity Forms is to change the default save and continue function in Gravity Forms, from the default of 30 days to a longer 90 days.

The second snippet is to disable automatic plugin updates for the core Gravity Forms plugin. This would be useful when you want to manually update the Gravity Forms plugin on a staging site, first to test before updating.

The next code snippet is where you wanted to require the card holder field on a form which has product fields and has a payment feed set on it.

Gravity Forms has a country select field. If you wanted to remove a country in the country select field, you can define the country, and use this code snippet.

The final code snippet applies if you are already using the Akismet plugin and service on your child site; Gravity Forms already has default integration with it. To send a specific form to Akismet, you can use this code snippet. If you needed to globally disable the Akismet integration in Gravity Forms, you can use this code snippet.

Easily adding code snippets to your connected child sites (which have Gravity Forms installed and activated) will allow you to easily make changes, as needed.

Manage all your WordPress sites with the MainWP Dashboard

WordPress Management for Professionals

Are you ready to go Pro?

All MainWP Pro Extensions are available through one of our convenient bundled packages.

1 thought on “Handy Code Snippets for Gravity Forms on your Child Site”

  1. Hello,
    Good work you doing here.
    I am current using Gravity form Ver 5.2.2 on my website.
    I want to add a field in the export enteries section of the plugin
    that requires uses to enter the “form ID” before they can export enteries of a particular form. Such that enteries can only be exported when the correct form ID is entered.
    Could you help with a code snippet for this?


Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Looking for something?

Your Download Is Just One Click Away

…or just download the plugin.

By entering your email, you agree to our Terms of Service and Privacy Policy.