Beginner guide: Merge Tags vs shortcodes
Understanding the difference between merge tags and shortcodes helps you get the most out of GravityView. This guide explains each concept in plain language and shows when to use one or the other.
What are merge tags?
Merge tags are placeholders that are replaced with real data when a View is displayed. You add a merge tag to your content, and GravityView fills it with values from a form entry.
Syntax
{Field name:ID}{field_id:123}
Example
Hello, {Name:1}! Your email is {Email:2}.
When displayed, this becomes:
Hello, John Smith! Your email is [email protected].
When to use merge tags
Use merge tags when you need to display individual pieces of data, such as
- Showing a single field value inside text
- Creating custom layouts with dynamic content
- Building email notifications or confirmations
- Inserting field values into HTML templates
What are shortcodes?
Shortcodes are WordPress commands wrapped in square brackets. They output complete blocks of content, such as an entire View or a specific part of a View.
GravityView shortcodes let you display Views without writing custom code.
Syntax
[shortcode attribute="value"]
Example
[gravityview id="123"]
This shortcode displays the View with ID 123 , including all configured fields, layouts, and settings.
When to use shortcodes
Use shortcodes when you want to:
- Embed a complete View on a page or post
- Display entry tables, lists, or single entries
- Add Views to widget areas or page builders
- Quickly display content using existing View settings
Merge tags vs shortcodes
| Feature | Merge tags | Shortcodes |
|---|---|---|
| Purpose | Insert individual field values | Display complete Views or View components |
| Syntax | {Field:ID} |
[gravityview id="X"] |
| Output | Single data values | Full layouts with multiple entries |
| Best for | Custom text, emails, templates | Pages, widgets, quick displays |
| Flexibility | High (granular control) | Moderate (uses View settings) |
| Learning curve | Moderate | Low |
Practical examples
Example 1: Display a directory
Goal: Show a searchable member directory on your site.
Best choice: Shortcode
Add the shortcode to any page:
[gravityview id="456" search_field="1,2,3"]
This displays the entire View with search enabled.
Example 2: Create a custom welcome message
Goal: Show a personalized greeting with the visitor’s name and membership level.
Best choice: Merge tags
Add this to a Custom Content field in your View:
<div class="welcome-box">
<h2>Welcome back, {Name (First):1.3}!</h2>
<p>Your membership level: <strong>{Membership Level:5}</strong></p>
<p>Member since: {Date Created:date_created}</p>
</div>
Example 3: Entry details page
Goal: Display all information for a single entry.
Best choice: Both
-
Use a shortcode to embed the View on a page:
[gravityview id="32" secret="936de4f06fe9"] - Use merge tags inside Custom Content fields to control formatting.
Common pitfalls and troubleshooting
Merge tags do not work in the WordPress editor
Problem: A merge tag such as {Name:1} appears as plain text.
Cause: Merge tags only work inside GravityView contexts, such as Views, Custom Content fields, and GravityView widgets.
Solution: Use a shortcode to display the View on a page:
[gravityview id="123"]
Mixing merge tag and shortcode syntax
Incorrect
[{Name:1}]
{[gravityview id="123"]}
Correct
{Name:1}
[gravityview id="123"]
Missing field ID in a merge tag
Problem: Using only the field name.
- Incorrect:
{Name} - Correct:
{Name:1}
Tip: You can find field IDs in the Gravity Forms form editor or by using the merge tag selector in GravityView.
Shortcode displays as text
Possible causes:
- The View is not published
- The View ID is incorrect
- The shortcode is missing brackets or contains a typo
- A plugin conflict prevents shortcodes from rendering
Solution: Confirm the View is published and double-check the shortcode syntax.
Summary
Choose merge tags when you:
- Need precise control over individual field values
- Create custom text layouts or templates
- Build personalized content
- Work inside GravityView Custom Content fields
Choose shortcodes when you:
- Want to display a complete View
- Embed Views in pages, posts, or widgets
- Prefer using View settings instead of custom formatting