Every visitor sees the same content
Generic pages cannot adapt messages for guests, members, customers, languages or devices.
Shortcodes Ultimate for WordPress
Show the right content to the right visitor. The Conditional shortcode lets you control WordPress content by user, role, device, language, schedule, request, post context or WooCommerce purchase.
Some messages should appear only to guests. Others belong to members, editors, mobile visitors, customers, a particular language or a limited campaign window. Showing everything to everyone makes pages less relevant and harder to maintain.
The Conditional shortcode keeps the rule next to the content it controls. Select one condition, provide its related value when needed, and wrap the text, HTML or other shortcodes that should appear when the rule matches.
Generic pages cannot adapt messages for guests, members, customers, languages or devices.
Even a simple logged-in check often means editing templates or maintaining a custom snippet.
Scheduled notices and targeted offers are easy to forget when they must be switched by hand.
Choose a condition, add the relevant value and wrap the content that should appear.
Build focused experiences without creating a separate page for every audience. These examples use the exact attribute names supported by the Conditional shortcode.
Show account links, downloads or instructions only to visitors who are signed in.
[su_conditional condition="logged_in"]View your account resources.[/su_conditional]
Invite logged-out visitors to register without repeating the same prompt for existing members.
[su_conditional condition="logged_out"]Create a free account to continue.[/su_conditional]
Give editors and administrators a note that remains hidden from other user roles.
[su_conditional condition="user_role" role="administrator,editor"]Editorial note: review this page.[/su_conditional]
Keep a launch, maintenance or promotion message visible only during a defined period.
[su_conditional condition="datetime" datetime_from="2026-11-27 00:00" datetime_to="2026-11-30 23:59"]The weekend offer is live.[/su_conditional]
Show a short instruction when WordPress identifies the current request as mobile or desktop.
[su_conditional condition="device" device="mobile"]Tap the menu icon to browse sections.[/su_conditional]
Reveal a download or onboarding link to a logged-in WooCommerce customer who bought a product.
[su_conditional condition="woocommerce_purchase" product_id="123,456"]Download your customer resources.[/su_conditional]
The shortcode includes conditions for visitor identity, request context, content context and schedules. It evaluates one selected condition at a time and ignores fields that belong to other conditions.
Install Shortcodes Ultimate from the WordPress plugin directory or the download page, then insert Conditional from the shortcode generator.
Select the visitor, date, request, post or WooCommerce rule that should control the content.
Keep Is for a direct match, or choose Is not to reverse the result.
Add only the values required by the selected condition; unrelated fields are ignored.
Place text, HTML or other shortcodes inside the wrapper, then test both matching and non-matching visits.
These examples use real [su_conditional] syntax. Replace roles, dates, cookie names, URLs, product IDs and content values with data from your site. See the Conditional shortcode documentation for the complete option reference.
[su_conditional condition="user_role" operator="is_not" role="administrator"]This notice is for non-administrators.[/su_conditional]
[su_conditional condition="language" language="en"]Read the English version of this guide.[/su_conditional]
[su_conditional condition="time" time_from="22:00" time_to="06:00"]Night support is now available.[/su_conditional]
[su_conditional condition="cookie" cookie_name="plan" cookie_value="pro"]Thanks for being a Pro member.[/su_conditional]
[su_conditional condition="url" url_contains="utm_source=newsletter"]Welcome, newsletter reader.[/su_conditional]
[su_conditional condition="referrer" referrer_contains="example.com"]Here is a resource for referred visitors.[/su_conditional]
[su_conditional condition="post_type" post_type="post,page"]This note appears on posts and pages.[/su_conditional]
[su_conditional condition="post_category" category="news,42"]Read the latest category update.[/su_conditional]
The shortcode evaluates conditions on the WordPress server. That makes the following implementation details important when you configure personalized or time-sensitive content.
A cached page can reuse one visitor’s output for another. Exclude or vary pages that depend on users, devices, cookies or purchases; the shortcode does not change cache settings.
The Device condition uses request headers on the server. It does not react to CSS viewport width and can also be affected by a CDN cache.
Browsers and privacy tools may omit or shorten HTTP referrer data, so it should not be the only control for important content.
Date, Time and Date and time conditions use the timezone configured in WordPress, not necessarily the visitor’s local timezone.
Shortcodes Ultimate combines conditional content with a broad library of reusable WordPress elements. Put a Button, Box or another supported shortcode inside Conditional to create a targeted call to action without rebuilding the component.
Explore related shortcodes such as Button, Box, Posts and Tabs, or browse the complete shortcodes library and documentation hub.
A WordPress Conditional shortcode shows its enclosed content only when a selected rule matches the current visitor or request. The Conditional shortcode in Shortcodes Ultimate can evaluate users, devices, languages, dates, times, cookies, URLs, referrers, post context and WooCommerce purchases.
Yes. Choose the logged_in condition for authenticated visitors or logged_out for guests. You can also select user_role when only specific WordPress roles should see the content.
Set operator="is_not". The shortcode will display its content when the selected condition does not match.
Date, Time and Date and time conditions use the timezone configured in WordPress under the site settings. Their range boundaries are inclusive.
No. Device detection happens on the server from request headers through WordPress. It does not change when a browser window is resized and should not replace responsive CSS.
Yes. The woocommerce_purchase condition accepts one or more product IDs and matches when the logged-in customer has bought any of them. WooCommerce must be active.
It can. Conditions based on users, devices, cookies or purchases may return the wrong output when a cache or CDN serves the same completed page to different visitors. Configure your cache to bypass or vary affected pages.
Yes. Developers can register a condition name with the shortcodes_ultimate_conditional_conditions filter and calculate its result with the shortcodes_ultimate_conditional_result filter.