Title: Yangra Conditional
Author: Suman Bhattarai
Published: <strong>November 14, 2026</strong>
Last modified: November 14, 2026

---

Search plugins

![](https://ps.w.org/yangra-conditional/assets/banner-772x250.png?rev=3801999)

![](https://ps.w.org/yangra-conditional/assets/icon.svg?rev=3801999)

# Yangra Conditional

 By [Suman Bhattarai](https://profiles.wordpress.org/metalfreek/)

[Download](https://downloads.wordpress.org/plugin/yangra-conditional.1.0.0.zip)

 * [Details](https://wordpress.org/plugins/yangra-conditional/#description)
 * [Reviews](https://wordpress.org/plugins/yangra-conditional/#reviews)
 *  [Installation](https://wordpress.org/plugins/yangra-conditional/#installation)
 * [Development](https://wordpress.org/plugins/yangra-conditional/#developers)

 [Support](https://wordpress.org/support/plugin/yangra-conditional/)

## Description

Yangra Conditional helps you display and hide content on your site depending on 
conditions you choose.

**Menu item visibility.** Show or hide any menu item for chosen visitors, in classic
menus (Appearance  Menus) and in the Navigation block. Hide “Log in” from logged-
in users, show a link only to Editors, hide a menu item on mobile. Hiding an item
hides its sub-items too.

**Block and widget visibility.** Every block, from WordPress or other plugins, gets
a Visibility panel. Classic widgets get the same rules in their settings.

**Scheduled elements.** Show or hide parts of your pages at set times: 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 page
caching.

**Scheduled content.** Write content in the block editor and schedule when it appears
on chosen pages and posts: above their content, below it, or in place of it. Supported
page caches are purged at each show and hide time.

**Conditional shortcode.** For the classic editor, page builders and text widgets:`[
yangra_conditional role="editor"]…[yangra_conditional_else]…[/yangra_conditional]`
shows its content only to matching visitors. Build it with Yangra Conditional  Shortcode
builder.

**Conditions:** user state (logged in or out), user role, page type, archive page
and visitor device. Combine them, choose Show or Hide, and use “is” or “is not”.

 * Rules are checked on the server: hidden items are never sent to the browser.
 * “Preview as” in the admin bar shows your site as a logged-out visitor, another
   role or a mobile device.
 * A Dashboard shows every rule and schedule on your site, with links to where they
   are set.
 * “Copy rule” and “Paste rule” reuse a rule on other menu items, blocks and widgets,
   across all the editors.

#### Yangra Conditional Pro

Pro adds more conditions and tools to the same editors. Learn more at https://yangrasoft.
com/yangra-conditional.

 * **Condition groups (OR):** a rule matches when any one of its groups of conditions
   matches, e.g. “the user is an Editor” or “the visitor is on mobile”.
 * **Visitor location:** show or hide content by the visitor’s country, e.g. a “
   Free shipping to the UK” notice. Countries are looked up on your own server, 
   with no external service.
 * **Visitor language:** match the visitor’s language, from Polylang or from the
   visitor’s browser.
 * **User groups:** make your own lists of users, such as “Staff” or “Wholesale 
   customers”, and use them in rules.
 * **Saved rules:** build a rule once and use it in any number of conditional shortcodes;
   change it in one place.
 * **Countdown:** a block and shortcode that count down to a scheduled element’s
   show or hide time.
 * **Preview at a date and time:** “Preview as” shows your site as it will look 
   at a chosen moment, with its schedules, countdowns and scheduled content.
 * **More for scheduled content:** visitor conditions on each item, a history of
   its cache purges, and a panel on each page that lists the items shown on it.

#### Third-party services

This plugin uses the [Freemius](https://freemius.com) SDK to handle optional usage
tracking (only after you opt in), licensing and upgrades to the Pro version. No 
data is sent to Freemius unless you opt in or purchase a license.

 * Freemius Terms of Service: https://freemius.com/terms/
 * Freemius Privacy Policy: https://freemius.com/privacy/

#### Source code

The minified JavaScript and CSS in `build/` are compiled from the human-readable
source in `assets/src/`, which ships with the plugin, using @wordpress/scripts (`
npm run build`).

The plugin includes the [Freemius WordPress SDK](https://github.com/Freemius/wordpress-sdk)(
version 2.13.5, GPLv3) in `vendor/freemius/wordpress-sdk/`, which handles opt-in
diagnostics and Pro licensing. Its source is available in that repository.

## Screenshots

[⌊A menu item in Appearance → Menus, shown only to logged-in visitors.⌉⌊A menu item
in Appearance → Menus, shown only to logged-in visitors.⌉[

A menu item in Appearance  Menus, shown only to logged-in visitors.

[⌊The Visibility panel on a block: show it to logged-in visitors, and hide it from
a set date.⌉⌊The Visibility panel on a block: show it to logged-in visitors, and
hide it from a set date.⌉[

The Visibility panel on a block: show it to logged-in visitors, and hide it from
a set date.

[⌊The Dashboard lists every rule and schedule on the site, with links to where each
is set.⌉⌊The Dashboard lists every rule and schedule on the site, with links to 
where each is set.⌉[

The Dashboard lists every rule and schedule on the site, with links to where each
is set.

[⌊Scheduled elements: show and hide any element with a class or ID at set times.⌉⌊
Scheduled elements: show and hide any element with a class or ID at set times.⌉[

Scheduled elements: show and hide any element with a class or ID at set times.

[⌊A scheduled content item, shown above the content of chosen pages between two 
dates.⌉⌊A scheduled content item, shown above the content of chosen pages between
two dates.⌉[

A scheduled content item, shown above the content of chosen pages between two dates.

[⌊The Shortcode builder for the classic editor, page builders and text widgets.⌉⌊
The Shortcode builder for the classic editor, page builders and text widgets.⌉[

The Shortcode builder for the classic editor, page builders and text widgets.

## Installation

 1. Upload the `yangra-conditional` folder to `/wp-content/plugins/`, or install it
    from the Plugins screen.
 2. Activate the plugin through the Plugins screen.
 3. Go to Yangra Conditional in the admin menu to configure it.

## FAQ

### Does hiding a menu item or block protect the page or content?

No. Hiding a menu item only removes the link: the page is still reachable by its
URL. A hidden block isn’t sent to the browser, but the post it’s in is still public.
To protect content, use a membership or access-control plugin.

### Are scheduled elements protection?

No. Scheduled elements are taken out of the page in the visitor’s browser, but they
are still in the page source, where search engines can find them, and visitors can
change their clock. Use them for promotions and announcements, not for anything 
secret. Visitors without JavaScript don’t see scheduled elements at all.

### Does it work with page caching?

Most conditions do. User state and role usually work, because caches skip logged-
in users; page type and archive page are the same for every visitor of a URL. Visitor
device can show the wrong result on a cached page, because the first visitor’s version
is cached for everyone. Exclude those pages from the cache, or use a cache that 
keeps a separate copy for mobile. Scheduled elements always work with caching. The
plugin never changes how your site is cached, with one exception: scheduled content
purges the pages it changes, see below.

### How does the Pro Visitor location condition find a visitor’s country?

It looks up the visitor’s IP address in a database stored on your site, so nothing
is sent to an outside service and the address is never stored. The data is the “
user-country” database from [ip-location-db](https://github.com/sapics/ip-location-db),
which is in the public domain (PDDL); it’s updated with each plugin release and 
imported in the background after an update. Country detection is approximate: visitors
on a VPN or proxy are matched by its country. Like Visitor device, Visitor location
can show the wrong result on a cached page. If your site is behind Cloudflare or
another proxy, choose where the address is read from in Yangra Conditional  Settings.

### How does the Pro Visitor language condition find a visitor’s language?

With Polylang active, it uses the language Polylang shows the page in, so it works
with page caching. Polylang is the only multilingual plugin supported: with WPML
or any other, or with none, it uses the languages the visitor’s browser asks for,
and matches if any of them matches; like Visitor device, this can show the wrong
result on a cached page. A language without a region matches every region: English
matches English (United States) and English (United Kingdom).

### Does scheduled content work with page caching?

Yes, with the supported caching plugins: WP Rocket, W3 Total Cache, LiteSpeed Cache,
WP Super Cache, WP Fastest Cache and SiteGround Optimizer. At each show and hide
time, and when an active item changes, the pages it’s shown on are purged from the
active one. Host caches and CDNs (such as Cloudflare) aren’t purged: clear them 
by hand, or purge them from your own code with the `yangra_conditional_purge_post`
action. The purges run on WP-Cron, which only runs when WordPress handles a visit,
so on a busy cached site they can run late. A real server cron job runs them on 
time.

### Where does scheduled content appear?

Only in the main content of the pages and posts you choose, through the `the_content`
filter: not in archives, excerpts, feeds or the REST API. Page builders that render
pages without `the_content` aren’t supported, so check pages built with one while
an item is active.

### Which menus are covered?

Menus shown with wp_nav_menu() (theme menu locations and the Navigation Menu widget)
and the Navigation block. Menus a theme or plugin builds in another way are not 
covered.

### What happens if I deactivate the plugin?

Every menu item, block and widget is shown again, including ones you hid from logged-
in users. Conditional shortcodes show as plain text, with both their content and
their “else” content. Your rules stay saved.

### Can I put one conditional shortcode inside another?

Yes, up to three levels. WordPress can’t put a shortcode inside another with the
same name, so use `[yangra_conditional_2]` inside `[yangra_conditional]`, and `[
yangra_conditional_3]` inside that. Each has its own “else” tag, e.g. `[yangra_conditional_2_else]`.

### I imported my content into another site. Do the rules still work?

Rules move with a WordPress export. Rules that use specific items (categories, tags,
terms or authors) are saved by ID, and IDs change on import, so check those rules
after importing.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Yangra Conditional” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ Suman Bhattarai ](https://profiles.wordpress.org/metalfreek/)

[Translate “Yangra Conditional” into your language.](https://translate.wordpress.org/projects/wp-plugins/yangra-conditional)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/yangra-conditional/),
check out the [SVN repository](https://plugins.svn.wordpress.org/yangra-conditional/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/yangra-conditional/)
by [RSS](https://plugins.trac.wordpress.org/log/yangra-conditional/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.0.0

 * Initial release.

## Meta

 *  Version **1.0.0**
 *  Last updated **2 days ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 6.5 or higher **
 *  Tested up to **7.1.4**
 *  PHP version ** 7.4 or higher **
 * Tags
 * [blocks](https://wordpress.org/plugins/tags/blocks/)[conditional](https://wordpress.org/plugins/tags/conditional/)
   [content](https://wordpress.org/plugins/tags/content/)[display conditions](https://wordpress.org/plugins/tags/display-conditions/)
   [visibility](https://wordpress.org/plugins/tags/visibility/)
 *  [Advanced View](https://wordpress.org/plugins/yangra-conditional/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/yangra-conditional/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/yangra-conditional/reviews/)

## Contributors

 *   [ Suman Bhattarai ](https://profiles.wordpress.org/metalfreek/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/yangra-conditional/)