Skip to content
StaxWP
WordPress Plugins

How to Set Content Visibility Based on the Browser Type

By the StaxWP teamUpdated November 16, 20265 min read
Content visibility based on browser type
Table of contents

To show or hide Elementor content by browser, install the free Visibility Logic for Elementor plugin, select the element in Elementor, open the Visibility tab, switch on Enable Visibility Logic, enable the Browser Type condition and pick the browsers. Set the action to Hide to keep the element out of those browsers, or to Show to display it only there. No code and no Elementor Pro needed.

Browser Type is a free condition. Below are the steps, how the browser is detected (which explains a few surprises on phones), and when Device Type is the better choice.

What do you need?

Step 1: Turn on Visibility Logic for the element

  1. Edit the page, post or template with Elementor.
  2. Select the widget, section or container, for example a video that does not play well in one browser.
  3. Open the Visibility tab. Older versions called it Stax Visibility.
  4. In the General section, switch Enable Visibility Logic to Yes.
General section of the Visibility tab with Enable Visibility Logic on, Show/Hide action Show, Conditions Type All and Keep HTML/Hide by CSS off
The General section. The condition sections appear below it once Enable Visibility Logic is on.

Step 2: Choose the action

Show/Hide action decides what happens when the visitor’s browser is one of the ones you pick.

  • Hide (the default): the element is hidden in those browsers and shown everywhere else. Use it for “not in Safari”.
  • Show: the element appears only in those browsers. Use it for “a note for Firefox users”.

Step 3: Enable Browser Type and pick the browsers

  1. Open the Browser Type section and switch Enable to Yes.
  2. In Browser, pick one or more of: Google Chrome, FireFox, Safari, Internet Explorer, Microsoft Edge, Netscape, Opera, Lynx, iPhone Safari, Android Browser.
  3. Click Update, then open the page in the browsers you picked.

The editor always shows every element, so check the result on the live page, in each browser. See Browser Type in the docs.

How is the browser detected?

The plugin reads the User-Agent header that every browser sends with a request and uses WordPress’s own browser checks. That has three consequences worth knowing before you build a rule.

Phones are matched as phones, not by browser name. Browsers on an iPhone are detected as iPhone Safari, and any browser on Android as Android Browser. Chrome on Android does not count as Google Chrome. If your rule is “hide in Chrome”, add Android Browser too when you also mean Android phones.

Chrome look-alikes count as Chrome. Browsers that send the same User-Agent as Chrome, Brave for example, are matched as Google Chrome. Edge and current Opera versions identify themselves and are matched as Microsoft Edge and Opera.

The header can be changed. Users can change their User-Agent with an extension or a privacy setting, and some do. Treat a browser rule as a convenience for most visitors, not a guarantee for every one.

Browser Type or Device Type?

Most “hide this on mobile” rules are about the screen, not the browser. For those, use the free Device Type condition, which matches Desktop, Tablet or Mobile. Unlike Elementor’s own responsive “hide on” switches, which hide with CSS, Device Type leaves the element out of the HTML for the other devices. See Device Type.

Use Browser Type when the problem really is one browser: a video format or an embed that one browser does not play, a feature you know is missing there, or a “this works best in” note.

Device Type section with Enable on and Tablet and Mobile selected in Device
Device Type, the better choice for rules about phones and tablets.

Mind the page cache

Visibility Logic decides on the server, when the page is built. A page cache stores one copy and serves it to every visitor, so a Safari visitor can get the copy built for a Chrome visitor. Exclude pages with browser rules from the page cache. For Device Type, turning on your cache’s separate mobile cache is usually enough. More in Rules look wrong for some visitors.

Show something else in that browser

In the free plugin a hidden element is simply not there. A common pattern that needs no Pro: build two sections, the video with Hide for Safari, and a short note or a different embed with Show for Safari. Each visitor gets one of the two.

With Visibility Logic Pro you can do it on one element: the Fallback section replaces the hidden element with a text or an Elementor template. See Fallback content.

Free or Pro?

Browser Type is free, together with User Role, User Meta, Date Time, Device Type and ACF Field. Visibility Logic Pro adds conditions such as Geo Location, IP & Referrer, URL Parameters, Post/Page, WooCommerce and EDD customers, plus fallback content. Pro costs $29 per year for 1 site, $39 for 3 sites and $79 for 100 sites. See the Free vs Pro table.

The short version

Enable Visibility Logic on the element, turn on Browser Type, pick the browsers and set the action. Remember that phones match as iPhone Safari and Android Browser, use Device Type for screen-size rules, and keep pages with browser rules out of the page cache. Start with the free plugin.