{Gravity Forms Shortcode Explained|Gravity Forms Shortcode – A Detailed Explanation}

Gravity Forms plugin can swirl like this geometric image!

This post is about Gravity Forms, a WordPress contact form plugin.

I know about Gravity Forms…but what are shortcodes?

Think of shortcodes as a placeholder for where other content will be displayed: instead of “Insert a Gravity Forms form here,” we use the `gravityform` shortcode. Learn more about shortcodes on WordPress.org.

The Gravity Forms `shortcode` has five pieces:

`

Oops! We could not locate your form.

`

  1. `id` (required) – The ID of the form, as displayed on the Gravity Forms Edit Forms page in the Id column
  2. `name` (required) – The name of the form.
  3. `title` – Show the title to users? Default is true; set to “false” to disable
  4. `description` – Show the form’s description to users? Default is true; set to “false” to disable.
  5. `ajax` – Submit the form without refreshing? Default is false; set to “true” to enable.

Gravity Forms Shortcode Examples:

`

`
Will result in Form #1 being displayed without a title or description, with no-refresh entry submission.

The shortcode above could be read as:Insert Gravity Forms Form #1 here. Do not show the title or description. The form should use Ajax to submit entries.

`

Work with KWS

  • Please check each box to show you've read what we're looking for!
  • What project best shows your abilities, and why?
  • Helpful, but not required.
  • This field is for validation purposes and should be left unchanged.
`
Will result in Form #2 being displayed. The title and description will be displayed (they are true by default), and entries will require a page-load (ajax is off by default).

`

`
Will result in Form #3 being displayed. The title will be displayed, but the description will not. Entries will not require a page-load (ajax is turned on).

Any questions?

This post has been created to make explicitly clear how the Gravity Forms shortcode works. If you have any unanswered questions, please leave them in the comments below and they will be answered.

An (advanced) note about custom Gravity Forms shortcode attributes:

In Version 1.6.5 of Gravity Forms, a feature was added to allow for custom shortcode attributes to be added by other Gravity Forms add-on plugins. This means that there may be more pieces to the shortcode in the future!

Author: Zack Katz

Zack Katz is the President of Katz Web Services and the developer of WordPress plugins with over 700,000 downloads. He lives in Southwest Colorado with his wife and two cats.

13 thoughts on “{Gravity Forms Shortcode Explained|Gravity Forms Shortcode – A Detailed Explanation}”

  1. Hey there! I have had to uninstall plugins from my WordPress blog because the CKEditor turned the shortcodes into literal text. I tried temporarily deactivating CK Editor (which kinda hurt, because it took an Ice Age to get it working correctly with CKFinder!) and activated the plugins I wanted on the site (A Business Directory and Contact Form) but then had problems with fonts and display.

    Is there a way ’round this?
    Cheers!

  2. When I use the [directory] short code, I can’t specify which form I want the entries to come from. It defaults to the first one. How do I specify which form I want? Also, when I click on the “add a gravity forms directory” icon in the WYSIWYG editor, it does nothing.

    1. Use [directory form=”#”] where # is the form id.

      What browser are you using? Does e Insert Directory error occur when you disable all other plugins except Gravity Forms and this one?

  3. Don’t forget about the field_values attribute. If you have fields set to dynamically populate, you can use it in the style of [gravityform id=#..... field_values="id=xx&day=xx"], etc.

Leave a Reply

Your email address will not be published. Required fields are marked *