BlogGravity Forms Shortcode Guide: Real Examples, Parameters, and the Best Ways to Embed Forms in WordPress

The Gravity Forms shortcode is still one of the main ways to embed a form in WordPress. Gravity Forms describes it as the primary way to display a form on your site, and it works anywhere WordPress supports shortcodes. That makes it useful in posts, pages, shortcode blocks, and many shortcode-friendly builders.

For many sites, that is enough. You add the form, hide the title or description if needed, maybe enable AJAX, and publish the page. But many Gravity Forms users eventually move beyond simple embedding. They start needing secure prefilling, connected data, smarter output, or front-end totals. That is where understanding the shortcode becomes more valuable, because it helps you see exactly where the built-in embed options end and where a more advanced workflow begins.

In this guide, you’ll learn what the Gravity Forms shortcode does, how its main parameters work, when shortcode is the best option, when the block or function-call method makes more sense, and how to know when you have outgrown the default embed options.

Gravity Forms shortcode guide illustration with GravityWP astronaut mascot and shortcode example in WordPress
A fun visual introduction to the Gravity Forms shortcode and the different ways WordPress users embed forms.

What the Gravity Forms shortcode actually does

A shortcode is a small piece of text inside square brackets that tells WordPress to output something dynamic. In Gravity Forms, the form shortcode displays a specific form on the front end. The required part is the form ID. The rest of the parameters control how that form is displayed or behaves.

Many users never type the shortcode manually because Gravity Forms can generate it for them. The Embed Form flyout, available in Gravity Forms 2.6 and newer, can create a new page or post, insert the form into existing content with the block editor, or copy the form shortcode for use in shortcode-friendly builders. That is why shortcode knowledge still matters even if you do not hand-write it every time.

The basic Gravity Forms shortcode format

At its simplest, the shortcode looks like this:

[gravityform id="1"]

That tells Gravity Forms to display form ID 1. The id parameter is the only required parameter.

A more complete example looks like this:

[gravityform id="3" title="false" description="false" ajax="true"]

This version still embeds the form, but it also hides the form title, hides the description, and enables AJAX submission. Gravity Forms also supports other useful parameters, including tabindex, field_values, theme, and styles.

Gravity Forms shortcode parameters explained in plain English

Here are the shortcode parameters most users should know.

ParameterWhat It DoesPlain-English Explanation
idSelects the form to displayThis is required. It tells Gravity Forms which form to show. If the wrong ID is used, the wrong form will appear or the shortcode may not work.
titleShows or hides the form titleThis controls whether the form title appears above the form. By default, Gravity Forms shows it, so title="false" hides it.
descriptionShows or hides the form descriptionThis controls whether the form description is displayed. It also shows by default unless you turn it off.
ajaxEnables AJAX form submissionThis controls whether the form submits without reloading the page. It can make confirmations and multi-page form steps feel smoother.
tabindexSets the starting tab orderThis controls keyboard navigation order. A value of 0 lets the browser handle tab order automatically.
field_valuesPasses default values into fieldsThis is used for dynamic population. It lets you prefill fields with values from the shortcode or other sources.
themeApplies a form themeThis lets you choose a theme by slug, such as orbital or gravity.
stylesPasses custom style settingsThis lets you apply JSON-encoded style settings. It is part of the shortcode reference, though many users may never need to write it manually.

Real Gravity Forms shortcode examples and when to use them

If you just want to embed a form on a page, this is enough:

[gravityform id="5"]

Use this when you simply want the form to appear and do not need to change anything else.

If the page already has its own heading and intro, this cleaner version is often better:

[gravityform id="5" title="false" description="false"]

Use that when showing the built-in form title and description would feel repetitive. Gravity Forms documents both parameters and their defaults.

If you want a smoother front-end experience, especially on longer forms, use AJAX:

[gravityform id="5" ajax="true"]

Gravity Forms supports AJAX in both the shortcode and the block settings.

If you want to prefill a field from the shortcode itself, use field_values:

[gravityform id="5" field_values="event_name=Workshop"]

You can also pass more than one value:

[gravityform id="5" field_values="event_name=Workshop&event_type=Live"]

Gravity Forms supports dynamic population through shortcodes, query strings, and hooks, but you must enable dynamic population on the target field first.

Shortcode vs block vs theme-file method

These methods overlap, but they are not identical.

Use the shortcode when you want portability

The shortcode is best when you want something you can copy and paste into shortcode-friendly areas. That includes classic content, shortcode blocks, and many builders. It is also useful when you want a text-based embed that is easy to reuse.

Use the block when you want the easiest editor-friendly option

The Gravity Forms block is best when you are working in the WordPress block editor and want a more visual setup. Current block settings include the form selector, title, description, theme, preview, AJAX, field values, and tabindex.

One important detail: it is no longer accurate to say the block uses the shortcode behind the scenes. In version 2.7.7, Gravity Forms updated the form block so it no longer uses the shortcode for rendering.

Use the theme-file or hook method when you are working in code

If you are embedding forms in a theme file or third-party hook, Gravity Forms documents the gravity_form() function call for that job. It supports parameters for title, description, field values, AJAX, tabindex, form theme, and style settings.

most useful advanced Shortcode feature: dynamic population

If you only remember one advanced shortcode parameter, make it field_values. Dynamic population lets one form behave differently depending on where you embed it. Gravity Forms lets you pass values through query strings, shortcodes, and hooks, and the block settings also include field values.

This is useful for event registrations, service inquiry pages, campaign landing pages, or any setup where the same form needs slightly different default values depending on where it appears. But there are limits. Gravity Forms specifically notes that dynamic population uses PHP, so it cannot be used in cached pages in the usual way.

That is where GravityWP starts to matter more.

JWT Prefill is the better fit when you need secure prefilling. GravityWP says it creates JSON Web Tokens to populate fields and validate data you do not want tampered with.

API Connector is the better fit when values need to come from an external API or when you need a reusable API connection with authentication and custom headers. GravityWP’s docs say you can add multiple APIs, manage authentication methods, set custom headers, and configure how data is sent and received through feed settings.

Advanced Merge Tags is the better fit when your next challenge is output control rather than prefilling. GravityWP describes it as an add-on that adds extra merge tag modifiers for tasks such as capitalization, trimming, formatting, and retrieving information.

Count is the better fit when the real need is not prefilling at all, but showing counts or totals. GravityWP says Count can count, filter, and display the number of entries or the total of a number field, and its docs include the gravitywp_count shortcode.

That is the key commercial takeaway: the Gravity Forms shortcode is excellent for embedding and basic population, but once your form becomes part of a larger workflow, a dedicated tool is often the cleaner long-term solution.

When the shortcode stops being enough

The default Gravity Forms shortcode is great at one main job: embedding a form with a few display and population options. It starts to fall short when your form needs more than that.

Common signs that you have outgrown the default shortcode are needing secure prefilling, API-driven data, more control over how values are displayed after submission, or front-end counts and totals. Those are exactly the areas where GravityWP’s add-ons are positioned: JWT Prefill for secure prefilling, API Connector for external data workflows, Advanced Merge Tags for output control, and Count for totals and counts.

The practical lesson is simple: do not force one shortcode to solve problems it was never designed to solve. Use the built-in shortcode for embedding. Use the right add-on when the workflow becomes more advanced.

The main form shortcode is not the only shortcode-related feature worth knowing.

Gravity Forms also supports a conditional shortcode for notification emails and confirmation messages. Its docs say the conditional shortcode lets you perform conditional logic in Admin and User Notification emails and in the Confirmation Message shown after submission.

It also supports chaining forms with shortcodes. Gravity Forms documents this as placing the shortcode for another form inside the confirmation of the first form so the second form displays after the first is submitted. Its docs also note that data from the first form can be carried into the second using parameters.

These are not everyday features for every site, but they are good examples of why shortcode knowledge still matters beyond simple embedding.

Common shortcode mistakes and limitations

The biggest limitation to know is this: Gravity Forms does not support embedding the same form multiple times on one page. That includes repeated use through shortcode, block, widget, function call, modal, accordion, tabbed interface, or slider. Gravity Forms says this can cause issues such as hanging submissions, wrong-form submissions, tabbing problems, CAPTCHA issues, and payment-related problems.

Other common mistakes are simpler. Users paste the wrong form ID. They put the shortcode into an area that does not support shortcodes. Or they assume field_values is enough for secure prefilling and more advanced connected workflows. In practice, those cases usually need something more purpose-built.

Need more than the default Gravity Forms shortcode?

If the standard shortcode is doing the job, keep it simple.

But if your form needs to do more than embed, GravityWP gives you more specialized next-step options:

That way, you are choosing a tool that matches the real bottleneck in the workflow instead of trying to stretch the default shortcode too far

GravityWP add-ons illustration showing advanced tools beyond the default Gravity Forms shortcode
When the default Gravity Forms shortcode is no longer enough, GravityWP add-ons can help with secure prefilling, API workflows, smarter output, and entry counts.

Final thoughts for Gravity forms shortcode

The Gravity Forms shortcode is still worth learning because it gives you a flexible, reliable way to embed forms in WordPress. Once you understand parameters like id, title, description, ajax, tabindex, field_values, theme, and styles, you can handle a lot of real-world form setups without touching custom code.

But the bigger win is knowing where the shortcode stops being the best answer. If all you need is a clean embed with a few display settings, shortcode may be enough. If you need secure prefilling, API-driven values, smarter output, or live totals from entry data, that is where the right GravityWP add-on becomes the practical next step.

Frequently Asked Questions

What is the Gravity Forms shortcode?

it’s the shortcode used to display a specific Gravity Form on your WordPress site. Gravity Forms describes it as the primary method used to display a form, and it can be used anywhere shortcodes are supported.

What is the basic Gravity Forms shortcode?

The most basic version is:
[gravityform id="1"]
The required part is the numeric form ID.

When should I use the shortcode instead of the block?

Use the shortcode when you want a portable, text-based embed you can paste into shortcode-friendly areas. Use the block when you want the easiest editor-based setup inside WordPress. Gravity Forms documents both methods separately, and the Embed Form flyout can also create block-based embeds or copy the shortcode for you.

What does field_values do?

It passes values into fields for dynamic population. Gravity Forms documents dynamic population through shortcode, query strings, and hooks, and the block settings also include a Field Values option.

Can I use the same Gravity Form multiple times on one page?

No. Gravity Forms says embedding the same form more than once on a single page is not supported and can cause several front-end problems.

What if I need more than the default shortcode can handle?

That depends on the limitation. Use JWT Prefill for secure prefilling, API Connector for external API workflows, Advanced Merge Tags for more output control, and Count for counts or totals. Those are the cases GravityWP’s docs directly support.

How do I know when to move beyond the standard shortcode?

A good rule is this: if your goal is only to embed a form and pass a few simple defaults, the shortcode is enough. If your form needs to protect prefilled values, work with external systems, control output more precisely, or display live totals, you have likely moved into a use case where a dedicated add-on is a better fit.

Proudly powered by WordPress