Free WordPress plugin
Yangra Conditional for WordPress
Show the right menu items, blocks and widgets to the right visitors, by login, role, page and device. Schedule parts of your pages to appear and disappear on time. No code needed.
One site, the right content for everyone
Members, customers, your team and first-time visitors don't need the same menu. Give each of them what fits.
Hide "Log in" once they have
Swap "Log in" for "My account" as soon as a visitor signs in.
Links only for your team
Show an "Edit pages" link to Editors and nobody else.
A lighter mobile menu
Hide a menu item or a heavy block on phones and tablets.
Sales that end on time
Show a sale banner from Friday 09:00 and take it down on Monday night.
From idea to live rule in three steps
- 1
Pick what to control
A menu item, any block, a classic widget, or a part of your page with a class or ID.
- 2
Add conditions
User state, user role, page type, archive page or visitor device. Combine them, choose Show or Hide, and "is" or "is not".
- 3
Check it with Preview as
See your site as a logged-out visitor, another role or a mobile device, straight from the admin bar.
Visibility panel
Same rules for menus, blocks and widgets
Wherever you edit your site, the rules look and work the same way.
- +Every block gets a Visibility panel, from WordPress or other plugins
- +Menu items in Appearance → Menus and in the Navigation block
- +Classic widgets get the same rules in their settings
- +Hiding a menu item hides its sub-items too
- +Badges in the menu editors show which items have rules
Hiding isn't protection. A hidden menu item only removes the link: the page can still be opened by its address. To keep content private, use a membership plugin.
Schedule it and forget it
Promotions, launches and announcements go live and come down on time, with no one at the keyboard. Times use your site's timezone.
Scheduled elements
Show or hide any block from its Visibility panel, or any element with a class or ID, from any theme or page builder. The switch happens in the visitor's browser, so it works with every page cache.
.promo-banner, #launch-videoBest for promotions and announcements. Scheduled elements are still in the page source, so don't use them for anything secret.
Scheduled content
Write content in the block editor and choose the pages and posts it appears on: above their content, below it, or in its place. Decided on your server, and cached pages are cleared at each show and hide time.
Cache clearing runs on WP-Cron, so on a quiet site it can run a little late. A real server cron job keeps it on time.
Page caches cleared automatically
- WP Rocket
- W3 Total Cache
- LiteSpeed Cache
- WP Super Cache
- WP Fastest Cache
- SiteGround Optimizer
- + a hook for your host or CDN
Conditional shortcode
One page, two versions
For the classic editor, page builders and text widgets. Show one thing to matching visitors and something else to everyone else.
[yangra_conditional user_state="logged_out"]
Log in to see member prices.
[yangra_conditional_else]
Your member price: $49
[/yangra_conditional]- Who the visitor is
user_staterolerole_not- Where they are on your site
page_typepage_type_notarchivearchive_not- Their device
devicedevice_not
Shortcode builder
Pick conditions with the same controls as the Visibility panel and copy the shortcode. No need to remember attribute names.
Nest up to three levels
Put [yangra_conditional_2] inside [yangra_conditional], and _3 inside that. Each level has its own "else".
Hidden means not sent
Visitor rules are checked on your server, before the page leaves it. Scheduled elements run in the browser, so they keep working behind a cache.
On your server
A hidden item is never sent to the browser. It isn't in the page source, so visitors can't find it with "View source".
Login, role, page and archive rules work with most page caches
In the visitor's browser
Elements are removed from the page at the right moment, before it is drawn. Every visitor can get the same cached page.
Works with every page cache
Visitor device can show the wrong version on a cached page, because the first visitor's copy is cached for everyone. Leave those pages out of the cache, or use a cache that keeps a separate copy for mobile.
Works with the way you build
Block themes and the block editor
A Visibility panel on every block, including blocks from other plugins, and on every item in the Navigation block.
Classic themes and page builders
Rules in Appearance → Menus and in classic widget settings. Use the shortcode in the classic editor, page builders and text widgets.
[yangra_conditional device="mobile"]Always know what visitors see
Preview as
See your site as a logged-out visitor, another role or a mobile device, then exit with one click.
One Dashboard
Every rule and schedule on your site in one place, with links to where each one is set.
Rules stay saved
Deactivate the plugin and everything shows again. Your rules stay saved for when you turn it back on.
Set your first rule today
Free to install from the WordPress.org plugin directory.