---
title: "Use [gvlogic]  to show (or hide) content anywhere on your site"
date: 2026-04-23
author: "GravityKit"
link: "https://www.gravitykit.com/docs/gravityview/advanced/show-or-hide-content-on-your-site/"
---

There's a much easier way to achieve the same results demonstrated on this page called "[Field Conditional Logic](https://www.gravitykit.com/docs/gravityview-pro/advanced-filter/field-conditional-logic/)".

## Use our shortcode to show and hide content on your site

GravityView adds multiple shortcodes to WordPress ( [see the list of GravityView shortcodes here](https://www.gravitykit.com/docs/gravityview/shortcodes/)), and one allows you to show or hide content based on rules you define: the [ shortcode](https://www.gravitykit.com/docs/gravityview/shortcodes/gvlogic-shortcode/).

*What's a shortcode? It's is a bit of text that you can add to your post or page that lets you perform complex functions without using code. A shortcode is a shortcut, and you can tell a shortcode because shortcodes are wrapped in square brackets, like this:* `[example]` *.*

## The `[gvlogic]` shortcode works everywhere

Some GravityView functionality only works inside a View, but the `[gvlogic]` shortcode works across your whole site: in posts, pages, Views, WordPress widgets…everywhere!

When you use `[gvlogic]` somewhere that isn't a View, you will be comparing values that aren't based on Gravity Forms data, so **make sure to use Merge Tags that don't rely on form and field values**.

### Use these Merge Tags with with `[gvlogic]` anywhere on your site

No matter where you use `[gvlogic]` , you can use these Merge Tags to show or hide content:

**GravityView Merge Tags**

- [{current\_post} - Access details of the current post or page](https://www.gravitykit.com/docs/gravityview/merge-tags/currentpost-merge-tag/)
- [{user} - Access details of the current user](https://www.gravitykit.com/docs/gravityview/merge-tags/the-createdby-merge-tag/)
- [{get} - Access details of the URL query string](https://www.gravitykit.com/docs/gravityview/merge-tags/the-get-merge-tag/)

**Gravity Forms Merge Tags**

- `{admin_email}` The email of the site administrator
- `{admin_url}` The URL of the dashboard for the site
- `{logout_url}` The URL to log out of the site

## Examples

### Show a message to the logged-in user:

If you want to show a message on a page to logged-in users, you can use the `[gvlogic]` shortcode, like this:

```
[gvlogic logged_in="true"]
  {user:display_name}, thanks for being logged in!
[/gvlogic]
```

```
[gvlogic logged_in="true"]
  {user:display_name}, thanks for being logged in!
[/gvlogic]
```

If the user's display name is "Ellen Ripley", when she is logged-in, she will see: "Ellen Ripley, thanks for being logged in!"

### Show a form only to logged-out users, and a View to logged-in users

If you want to gather data for visitors and allow logged-in users of your site to see that content, you can do that with the following code. It will display a Gravity Forms form to logged-out users and will display the submitted entries in a GravityView View to logged-in users:

```
[gvlogic logged_in="true"] 
  Here are the form submissions:
  [gravityview id="45"]
[else]  
  Please fill out this form!
  [gravityforms id="123"]
[/gvlogic]
```

```
[gvlogic logged_in="true"] 
  Here are the form submissions:
  [gravityview id="45"]
[else]  
  Please fill out this form!
  [gravityforms id="123"]
[/gvlogic]
```

### Show content only to visitors arriving from Google Adwords

When a user visits your site from Google Adwords, they have `?gclid=xxxxxx` added to the URL. If you want to display content targeted only to them, you can:

```
[gvlogic if="{get:gclid}" isnot=""]
Hi! We have a special offer for Google customers!
[/gvlogic]
```

```
[gvlogic if="{get:gclid}" isnot=""]
Hi! We have a special offer for Google customers!
[/gvlogic]
```

The possibilities are endless for how to conditionally show and hide content on your site using the `[gvlogic]` shortcode.