---
title: "Feature Highlight: The [gravityview] Shortcode"
date: 2022-07-01
author: "Casey Burridge"
link: "https://staging.gravitykit.com/gravityview-shortcode/"
---

# Feature Highlight: The [gravityview] Shortcode

In this edition of [Feature Highlights](https://cf61600d-90c1-49ac-b4a6-d97914c46f41.cv03.conves.io/tag/feature-highlight/), we’re exploring the powerful \] shortcode. No, it’s not only for embedding Views! The  shortcode allows you to filter entries by specific values, display the total number of entries in a View, and much more.

Shortcodes in WordPress are text strings enclosed in square brackets. They allow you to embed interactive content on your site without writing any code. [GravityView](https://cf61600d-90c1-49ac-b4a6-d97914c46f41.cv03.conves.io/features/) adds several new shortcodes to WordPress including the \] shortcode which we’re going to explore in this post 👇

## How to use the \] shortcode

You can find the \] shortcode on the View Editor page above the "Update" button. Here it’s referred to as the “Embed Shortcode”, but there’s a lot more you can do with it besides simply embedding Views.

![The GravityView embed shortcode displayed on the View editor page](https://cf61600d-90c1-49ac-b4a6-d97914c46f41.cv03.conves.io/wp-content/uploads/2022/06/image-22.png)
*The shortcode only has one required parameter: the View ID. All other parameters are optional and can be used if/when you need them!*

### Shortcode parameters

The \] shortcode accepts a wide range of parameters. Here are some of the common ones that you can use to filter your Views based on specific field values:

- `search_value` - Only display entries that contain the specified value
- `search_field` - Restrict the search\_value to a specific form field. The value must be the field ID, unless you’re searching on a meta field (e.g. “created\_by”).
- `search_operator` - Change the type of search to be performed. The default is "contains". Accepted values include: `is`, `isnot`, `<>`, `not in`, `in`, `>`, `=`, `<=.`
- `start_date` - Filter the results by date. This sets a limit on the earliest results shown.
- `end_date` - This sets a limit on the latest results shown.
- `detail` - Display specific information about a View. The detail parameter can be used inside a [Custom Content field](https://cf61600d-90c1-49ac-b4a6-d97914c46f41.cv03.conves.io/custom-content-field/) to display information about the currently-displayed View.

**Pro tip**To see a full list of accepted parameters, check out [this detailed article](https://docs.gravitykit.com/article/73-using-the-shortcode) on our docs site.

## Use Cases for the \] Shortcode

Reading through a list of different shortcode parameters is all well and good, but sometimes it helps to look at some examples of common use cases.

**1. Embedding a View:**

```
[gravityview id="24"]
```

**2. Filtering a View to display entries that contain a certain value:**

```
[gravityview id="24" search_value="Silver Member" search_field="4"]
```

**3. Limiting entries by date created:**

```
[gravityview id="24" start_date="2021-10-01" end_date="2021-10-31"]
```

**4. Displaying the total number of entries in a View:**

```
[gravityview id="10" detail="total_entries"]
```

**Pro tip**You can use a \] shortcode with the detail parameter inside a [custom content field](https://cf61600d-90c1-49ac-b4a6-d97914c46f41.cv03.conves.io/tag/feature-highlight/) to display information about the View being displayed.

There are plenty more use cases for the \] shortcode. To see more examples of things you can do, check out [our documentation](https://docs.gravitykit.com/article/73-using-the-shortcode).

## What the \] Shortcode CAN’T Do

We’ve focused a lot on what the \] shortcode CAN do (and it can do a lot of things!), but it’s also important for us to mention what it CAN’T do.

While \] includes some powerful filtering capabilities, there are some limitations. For example, you can’t search for multiple values or specify multiple search fields. You also cannot use AND/OR logic in searches.

However, if you need this functionality, don’t despair, because you can accomplish this with our [Advanced Filtering extension](https://gravityview.co/products/advanced-filter/).

## Get Started With the \] Shortcode!

In this edition of Feature Highlights, we explored the powerful \] shortcode. Using the shortcode, you can embed Views, filter entries based on various criteria and display specific details about a particular View.

To learn more about the \] shortcode, read the [article](https://docs.gravitykit.com/article/73-using-the-shortcode) on our docs site, or watch the [tutorial video](https://www.youtube.com/watch?v=bNCnuj0btDE) on our YouTube channel. For more helpful hints and tips subscribe to our blog below!