Documentation
Content Visibility
Control the visibility of page and post content with the If and Else elements in WPBakery or the classic editor.
There are two ways to control content: the WPBakery elements (recommended) or the shortcode generator in the classic editor. Both use the same conditions.
Using WPBakery
Place the elements you want to control inside the If/Else containers, then set the condition. This example shows content only on mobile devices.
- Create a new page and open the WPBakery editor.
- Click Add Element and choose WP Brain If.
- The settings dialog opens automatically. Build your condition there.
- Select the Device filter and set the rule to match the screenshot below:

Adding a device rule to the WP Brain If element. - Place the mobile content inside the green If container:

Content placed inside the If container. - Add a WP Brain Else element after the green container and put the fallback content inside the orange container:

Adding an Else container for every other device. - Save the page and test it on different devices.
Using the text editor
Without WPBakery, you can achieve the same result with the shortcode generator. Here's the same mobile-only example using the classic editor.
- Create a preset. Go to WP Brain > Settings, find the presets box and click Add New.
- Fill the fields as shown below and save:

Creating a device preset. - Create a new page to test with.
- Write two lines: one for mobile, one for every other device.

Two lines ready for If/Else wrapping. - Select the first line, click the WP Brain icon in the editor toolbar and choose If.

Choosing If from the editor toolbar. - Choose the condition preset in the dialog and click OK.

Selecting a saved preset. - Select the second line, open the WP Brain menu and choose Else.
- The editor should now show a matching pair of shortcodes:

The finished If/Else shortcode pair. - Save the page and test it on your devices.
The rest of this guide focuses on the WPBakery elements; the classic editor follows the same process.
