View Categories

Shortcode Builder

Free during launch — availability as a free feature may change in a future release.

Overview #

The Shortcode Builder is a visual, point-and-click tool built directly into the GravityOps Search admin page. It lets you construct [gravops_search] shortcodes interactively without writing any shortcode syntax by hand. Every attribute, search filter, display option, and output template is wired to a live UI control, and the shortcode preview updates in real time as you configure it.

Navigate to GravityOps → GravityOps Search → Shortcode Builder to open it.


Building a shortcode #

1. Target forms #

Choose which Gravity Forms to search:

  • All forms — check “All forms” to query every form on the site (target="0").
  • Specific forms — leave the checkbox unchecked and tick one or more forms from the list. The first selected form is the primary form and drives the field-aware UI (field dropdowns, sort options, etc.). You can reorder the selection or mark a different form as primary using the “Make primary” button on each chip.

2. Attributes #

The Attributes card covers the core shortcode settings:

Setting Shortcode attribute
Match mode (ALL / ANY) search_mode
Search empty values search_empty
Sort by / direction / numeric sort_key, sort_direction, sort_is_num
Secondary sort secondary_sort_key, secondary_sort_direction
Limit limit
Unique results only unique
Result separator separator
Default value(s) default
Wrap in admin entry link link

3. Search filters #

Click + Add filter to add a search condition. Each row maps to one position in the search / operators / content pipeline:

  • Field — pick any entry property or field from the primary form’s schema. Choosing a field with choices (radio, select, checkbox) switches the value input to a dropdown automatically.
  • Operator — the available operators adjust to the field type (numeric fields get gt, lt, etc.; boolean fields get = and != only).
  • Value — plain text, a number, a date picker, or a comma-separated list for in / not in operators.

Rows can be reordered by dragging the numbered handle on the left. Click Remove to delete a row.

4. Display mode #

Switch between the two output modes using the tabs under the Display card:

Simple field list — tick one or more fields, entry properties, or special values (meta, num_results). Each entry outputs those values in order. Use “Discover available meta keys for this form” to run a quick introspection query.

Template builder — stack blocks to assemble a per-entry output template:

Block type What it does
Text Literal text inserted verbatim
Field placeholder Inserts a field or property value: {13}, {gos:id}, etc.
HTML wrapper Wraps child blocks in an HTML element with optional attrs/classes
Nested shortcode Emits a {{shortcode}} that the plugin resolves after placeholder substitution
Special {num_results} or {gos:num_results}

Blocks can be nested inside HTML wrappers and reordered by dragging.


Live shortcode preview #

Displays the current shortcode. Click Display Shortcode to refresh, or Copy Shortcode to copy it to the clipboard with one click.

Validation #

Runs automatically and flags common issues:

  • Error (red) — the shortcode will not work correctly as configured (e.g., no form selected, pipe character in a value, bare gos:id used with a text key).
  • Warning (yellow) — likely unintended configuration (e.g., in operator with no values, search_empty on while values are present).
  • Info (blue) — informational notes (e.g., multi-form mode, limit="all" performance reminder, default/display count mismatch).

Test run #

Click ▶ Run shortcode to render the current shortcode on the server and preview the output in the panel. This is a live query — it reflects the actual entries in your database.

Save shortcode #

Enter a name and click Save to persist the current shortcode and its builder state to the Saved Shortcodes tab. Saved shortcodes are stored site-wide and visible to all users with the appropriate capability.

Presets #

Presets are personal (per-user) saves of the full builder state. They are useful for storing partially-built configurations or frequently reused setups that you want to come back to without saving a final shortcode. Presets are separate from Saved Shortcodes.

Starter templates give you a pre-configured state as a starting point for common patterns.


Saved Shortcodes tab #

Navigate to GravityOps → GravityOps Search → Saved Shortcodes to manage all shortcodes saved from the builder.

Each card shows:

  • Name and the date it was saved.
  • Shortcode — click anywhere on the code block to copy it to the clipboard. The block flashes green on a successful copy.
  • Edit in Builder — loads the saved state back into the Shortcode Builder tab so you can modify it and re-save.
  • Delete — removes the entry after a confirmation prompt.

Data storage and cleanup #

Data Where stored Removed on uninstall
Saved shortcodes wp_options (gos_saved_shortcodes) Yes
Per-user presets wp_usermeta (gos_sb_presets) Yes — all users