GravityOps Search

A powerful and flexible Gravity Forms search and display shortcode for WordPress.

πŸ“ Description

The gravops_search shortcode enables advanced searching and displaying of Gravity Forms entries on your posts, pages,
Gravity Views, or custom templates. It functions similarly to an Excel VLOOKUP, allows filtering results, sorting entries, custom formatting, and much moreβ€”all
tailored to your exact needs.

✨ Key Features

  • Form Targeting: Search entries across all forms, specific forms, or selected forms via IDs.
  • Field Filtering: Search or display multiple fields simultaneously using field IDs and corresponding values.
  • Custom Formatting: Customize output using placeholders and HTML formatting, supporting field data and meta-properties.
  • Sorting Options: Primary and secondary sorting by ascending, descending, or random order.
  • Comparison Filters: Filter numeric fields by values (greater than or less than).
  • Global Search: Search all form fields for specific values easily.
  • Unique Results: Eliminate duplicate entries by enabling the unique option.
  • Advanced Search Modes: Match any condition (search_mode="any") or all conditions (default).
  • HTML Supported in Display: Fully supports HTML in display and separator attributes, e.g., <li> for lists.
  • Search for Empty Fields: Identify and display entries with missing field data.
  • Entry Linking: Convert results into links to entry admin panel views.

πŸš€ Usage

To use the shortcode, embed in your content areas with relevant attributes, e.g.: 

[gravops_search target="1" display="13"]

This displays the value of field ID 13 from the latest entry in form 1.

Attributes Overview

Attribute Description Default
target Specify forms to search: 0 for all forms, or comma-separated list of form IDs (e.g., target="1,2"). (all forms) 0
search Field IDs/entry properties for filtering entries. Separate multiple IDs by a comma (search="13,14"). The corresponding values to search for should be placed in the shortcode content, separated by the pipe operator. (None)
operators Comma-separated list of operators that correspond to each field in the search attribute. See documentation below for a list of supported operators. (None)
display Comma separated list of field IDs/entry properties to display. Also allows formating results with placeholders. (Required)
search_mode Match all conditions (all, default) or any condition (any). all
sort_key Field/property to sort entries (e.g., field ID or meta key). id (entry ID)
sort_direction Sorting direction: ASCDESC, or RAND. DESC
sort_is_num Indicates if sorting is numeric (true/false). true
secondary_sort_key Secondary sorting field (if needed). (empty)
secondary_sort_direction Sorting direction for the secondary sort (ASC, DESC). DESC
unique Display only unique values in the results. false
limit Number of results to display. Use limit="all" to display all entries. 1
separator Separator between entry results (supports HTML). Will only be used when there is more than one entry returned by the search. To configure a blank separator, enter __none__. (Varies)
search_empty Search for fields with empty/blank values. false
default Default text to display if no results match search criteria. Can input multiple values corresponding to each display value, separated by a double pipe symbol. (Blank)
link Makes results clickable links to admin entry details. false

🧩 Examples

Example 1: Display fields 16 and 17 (comma separated) when field 13 matches John and 14 matches john@example.com

This will display the results from the five latest matching entries from form 1. The entry results will be each on a new line.
The shortcode will return ‘No results found’ for any blank entries or blank results in matching entries.

[gravops_search target="1" search="13,14" display="16, 17" limit="5" separator="<br>" default="No results found"]
John|john@example.com
[/gravops_search]

Example 2: Search and Display Multiple Fields

[gravops_search target="2" search="13,14" display="Name: {13}, Email: {14}" search_mode="all" limit="10"]
John|john@example.com
[/gravops_search]

This will return a list of unique created_by values from form 3. Each will link to its corresponding admin entry view.

[gravops_search target="3" display="Unique Entry: " unique="true" link="true"]

Example 4: Global Search with Custom HTML

This searches across all forms and fields and creates an HTML list showing the entry ID and the value of field 13.

[gravops_search target="0" display="<li>ID: {id}, Value: {13}</li>" separator="__none__"]

Wrap the above shortcode within <ul> tags:

<ul>
    [gravops_search target="0" display="<li>ID: {id}, Value: {13}</li>" separator="__none__"]
</ul>

Example 5: Creating an HTML table with links

 <table>
    <thead>
      <tr><th>Name</th><th>Email</th><th>Link</th></tr>
    </thead>
    <tbody>
    [gravops_search target="1" search="3,5" display="<tr><td>{1}</td><td><a href='mailto:{2}'>{2}</a></td><td><a href='{6}&query={10}'>{6}&query={10}</a></td></tr>" separator="__none__"]
    John Doe | john@example.com
    [/gravops_search]
    </tbody>
  </table>

You can create links to anywhere you want, including other views or parts of this view!

Example 6: Secondary Sort

  [gravops_search target="2" display="13" sort_key="date_created" secondary_sort_key="name" secondary_sort_direction="ASC"]

Docs

Installation

Download and install from the WP repo here or straight from your admin dashboard.

Please note this plugin developed from our GFsearch snippet. The snippet will no longer receive updates but will still be available in the snippet directory if you would like to use it. If you use the legacy snippet version make sure to the use the shortcode tag gfsearch instead of gravops_search. The snippet is compatible with the plugin-meaning you can install them both on the same site and use both shortcode tags.