[Go to site: main page, start]

WordPress plugin

Show the right thing to the right visitor.

ShowIf wraps any content in a condition: logged in or not, user role, device, time of day, a link parameter, a cookie, country or WooCommerce data. Shortcode conditions are decided on the server, so a visitor who doesn't qualify never receives the hidden content.

  • $29 once, no subscription
  • Shortcode or CSS class
  • Full GPL source
showif.webkodingtheme.com/wp/showif-demos/
Try it: be a different visitor
Visitor
Device
Link
Store time
  • [showif loggedin="true"] … [showif_else] …
  • [showif role="administrator"] … [showif_else] …
  • [showif url_param="vip=1"] … [showif_else] …
  • [showif device="mobile|tablet|desktop"] …
  • [showif time="09:00-17:00"] … [showif_else] …
The same five boxes, as they render on the demo page.Open it for real

See it run on the demo store

A 90-second recording of the live demo: one page seen by a guest and by a member, the page source, and a rule built in the admin. Pick a chapter to jump to it.

No sound; the captions say what is happening.

One page, two visitors

Both screenshots are the same URL on the demo store. Nothing was edited between them; only the visitor changed.

Demo page as a guest: the first box says log in to see the member price, the role box says hidden, no VIP welcome
Guest. Gets the fallback text from [showif_else].
Demo page as the logged-in demo administrator: the member price of $24 and the administrator line are shown
Logged-in member. Gets the member price and the administrator line.

Three ways to use it

They work in any editor or page builder that accepts a shortcode or a CSS class: the block editor, Elementor, Divi, WPBakery, Bricks and the rest. The block editor and Elementor also get a ShowIf panel where you pick a saved rule.

Shortcode

Wrap the content. Add a fallback with [showif_else]. Several attributes means all of them must match; logic="OR" means any.

[showif role="subscriber"]
  Member content
[/showif]
[showif_else]
  Please log in.
[/showif_else]

Decided in PHP. Hidden content is not in the HTML the visitor receives.

CSS class

No shortcode: put a class on a block, section or widget in your builder's CSS class field.

showif--loggedin-true
showif--device-mobile

Elements that don't match are hidden with display:none, so they are still in the page source. Use the shortcode for anything private.

Rule builder

Pick conditions in the admin, combine them with AND or OR, negate any row, and copy the shortcode, CSS class and fallback it writes for you.

Name: Members on mobile
Login status  = Logged in
AND Device    = Mobile

Use a saved rule anywhere with [showif rule="slug"], the class showif--rule-slug, or the ShowIf panel in the block editor and Elementor.

Inside the admin

Screenshots from the demo. Log in with the demo account shown on the login page and click around; settings can't be saved there.

A name and a list of conditions

Start from a quick pick (Mobile, Logged-in, Subscriber, Country, Business hours) or add rows one by one.

  • AND needs all rows, OR needs one
  • Negate (NOT) on any row
  • Drag rows to reorder
ShowIf › Add New Rule
Add New Rule screen: rule name Members on mobile, conditions Login Status is Logged In AND Device is Mobile, with Save Rule on the right

What a condition can check

Each one works as a shortcode attribute. Put ! before a value to negate it.

Login state

Logged in or a guest.

loggedin="true"

User role

Any role, including custom ones.

role="subscriber"

Specific users

One or more user IDs.

user_id="42"

Device

Mobile, tablet or desktop, read from the browser's user agent.

device="mobile"

Time of day

A daily window in your site's timezone.

time="09:00-17:00"

Day of week

One or more weekdays, site timezone.

day="saturday,sunday"

Date range

Between two dates, inclusive, or from a date on.

date="2026-12-01:2026-12-31"

Link parameter

A value in the address, for campaigns and partner links.

url_param="ref=partner"

Referrer

The page the visitor came from contains some text.

referrer="google"

Current address

The URL contains, starts with, ends with or equals a path.

current_url="starts_with:/shop"

Cookie

A cookie exists, or has a given value.

cookie="vip_user=1"

Returning visitor

How many pages this browser has loaded, counted on the server.

visits=">=3"

Scroll depth

Revealed once the visitor scrolls past a percentage of the page.

scroll="60"

Country

From the country header Cloudflare or your server adds. An online lookup at ipapi.co (sends the visitor's IP) is off until you switch it on.

country="US,CA"

ACF field

The value of an Advanced Custom Fields field.

acf_field="is_premium=1"

WooCommerce: purchases

Bought a given product, spent more than an amount, or no orders yet.

woo_spent=">500"

WooCommerce: cart

Cart subtotal compared with an amount, or a product in the cart.

woo_cart=">=50"

Saved rule

A rule built in the admin, reused by its slug.

rule="vip-access"

Fallback

What to show everyone else, right after the condition.

[showif_else]

One price, no subscription

$29one-time
  • 1 WordPress site
  • 1 year of updates and email support
  • Full GPL source, runs on your server
  • After the year it keeps working; renew only for new versions
Buy ShowIf for $29

Sold through Paddle as Merchant of Record: Paddle issues the invoice, handles VAT and refunds. 30-day refund policy. The licence key and download link arrive by email.

Requires PHP 7.4 or newer. WooCommerce only for the shop conditions; everything else works on plain WordPress.

Questions

Anything else: support@webkoding.com, or the documentation.

Is hidden content still in the page source?

Not with the shortcode: it is decided in PHP and content a visitor doesn't qualify for isn't sent. With a CSS class, the element is hidden with display:none and is still in the source, so use the shortcode for anything private. Neither protects files: a direct link to an upload still works.

Does it work with my page builder?

Anywhere you can type a shortcode or set a CSS class: the block editor, Elementor, Divi's CSS Class, WPBakery's Extra Class Name, Bricks and others. The block editor (a ShowIf panel in every block's sidebar) and Elementor (a ShowIf section in the Advanced tab) also let you pick a saved rule without any code; a block or element that doesn't match isn't sent at all. Divi, WPBakery and the rest have no ShowIf panel: use the shortcode or class there.

Do I need WooCommerce?

Only for the purchase and cart conditions. Everything else works on plain WordPress (ACF conditions need ACF).

What if I mistype an attribute?

The content stays hidden, never shown to everyone. An attribute ShowIf doesn't know, an empty value, a deleted saved rule or a WooCommerce condition without WooCommerce never matches, and administrators see a short note on the page naming what was ignored.

Does ShowIf send visitor data anywhere?

Not by default. Country comes from the header Cloudflare or your server adds. If you have no such header you can switch on an online lookup in Settings, which sends the visitor's IP address to ipapi.co; it is off until you do. The AI assistant sends only the text you type, to OpenAI, with your key.

Does it work with page caching?

A full-page cache serves the same HTML to everyone, so a page cached for a guest will show guests' content to the next visitor. Exclude pages that use ShowIf from the cache, or rely on caches that already skip logged-in users when you only switch on login state.

What does the AI assistant need?

Your own OpenAI API key, entered in Settings. You describe the audience in plain English and it suggests conditions using the gpt-4o-mini model; requests go from your server to OpenAI. Without a key it stays off.

What are the limits?

Version 1.0.1 fixed the conditions and saved rules that didn't evaluate in 1.0.0, and removed the unfinished Popups, A/B Tests and Visual Builder screens. What remains true: there is no ShowIf panel for Divi or WPBakery (shortcode and class work there); country needs a CDN/server header or the opt-in online lookup; the device CSS class uses screen width while the shortcode uses the browser's user agent; and an element hidden by a CSS class is still in the page source. Popups exist only as part of the one-click AI Recipes; there is no popup manager.

Switch the visitor and watch the page change

Open the examples page in the demo store, use the corner button to switch between guest and member, then add ?vip=1 to the address.