{"id":398656,"date":"2026-11-14T13:44:52","date_gmt":"2026-11-14T13:44:52","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/yangra-conditional\/"},"modified":"2026-11-14T13:44:29","modified_gmt":"2026-11-14T13:44:29","slug":"yangra-conditional","status":"publish","type":"plugin","link":"https:\/\/yor.wordpress.org\/plugins\/yangra-conditional\/","author":5061802,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.4","requires":"6.5","requires_php":"7.4","requires_plugins":null,"header_name":"Yangra Conditional","header_author":"Suman Bhattarai","header_description":"Yangra Conditional helps you display and hide content on your site depending on conditions you choose.","last_updated":"2026-11-14 13:44:29","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/yangrasoft.com\/yangra-conditional","header_author_uri":"https:\/\/sumanbhattarai.com.np","rating":0,"author_block_rating":0,"active_installs":0,"downloads":83,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"metalfreek","date":"2026-11-14 13:44:29","revision":3801999}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3801999,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3801999,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256},"icon.svg":{"filename":"icon.svg","revision":3801999,"resolution":false,"location":"assets","locale":false}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3801999,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3801999,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3801999,"resolution":"1","location":"assets","locale":"","width":1280,"height":980},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3801999,"resolution":"2","location":"assets","locale":"","width":1280,"height":1170},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3801999,"resolution":"3","location":"assets","locale":"","width":1280,"height":1350},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3801999,"resolution":"4","location":"assets","locale":"","width":1280,"height":680},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3801999,"resolution":"5","location":"assets","locale":"","width":1280,"height":1066},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3801999,"resolution":"6","location":"assets","locale":"","width":1280,"height":910}},"screenshots":{"1":"A menu item in Appearance \u2192 Menus, shown only to logged-in visitors.","2":"The Visibility panel on a block: show it to logged-in visitors, and hide it from a set date.","3":"The Dashboard lists every rule and schedule on the site, with links to where each is set.","4":"Scheduled elements: show and hide any element with a class or ID at set times.","5":"A scheduled content item, shown above the content of chosen pages between two dates.","6":"The Shortcode builder for the classic editor, page builders and text widgets."}},"plugin_section":[],"plugin_tags":[4121,4060,529,227461,6309],"plugin_category":[],"plugin_contributors":[195721],"plugin_business_model":[],"class_list":["post-398656","plugin","type-plugin","status-publish","hentry","plugin_tags-blocks","plugin_tags-conditional","plugin_tags-content","plugin_tags-display-conditions","plugin_tags-visibility","plugin_contributors-metalfreek","plugin_committers-metalfreek"],"banners":{"banner":"https:\/\/ps.w.org\/yangra-conditional\/assets\/banner-772x250.png?rev=3801999","banner_2x":"https:\/\/ps.w.org\/yangra-conditional\/assets\/banner-1544x500.png?rev=3801999","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":"https:\/\/ps.w.org\/yangra-conditional\/assets\/icon.svg?rev=3801999","icon":"https:\/\/ps.w.org\/yangra-conditional\/assets\/icon.svg?rev=3801999","icon_2x":false,"generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-1.png?rev=3801999","caption":"A menu item in Appearance \u2192 Menus, shown only to logged-in visitors."},{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-2.png?rev=3801999","caption":"The Visibility panel on a block: show it to logged-in visitors, and hide it from a set date."},{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-3.png?rev=3801999","caption":"The Dashboard lists every rule and schedule on the site, with links to where each is set."},{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-4.png?rev=3801999","caption":"Scheduled elements: show and hide any element with a class or ID at set times."},{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-5.png?rev=3801999","caption":"A scheduled content item, shown above the content of chosen pages between two dates."},{"src":"https:\/\/ps.w.org\/yangra-conditional\/assets\/screenshot-6.png?rev=3801999","caption":"The Shortcode builder for the classic editor, page builders and text widgets."}],"raw_content":"<!--section=description-->\n<p>Yangra Conditional helps you display and hide content on your site depending on conditions you choose.<\/p>\n\n<p><strong>Menu item visibility.<\/strong> Show or hide any menu item for chosen visitors, in classic menus (Appearance \u2192 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.<\/p>\n\n<p><strong>Block and widget visibility.<\/strong> Every block, from WordPress or other plugins, gets a Visibility panel. Classic widgets get the same rules in their settings.<\/p>\n\n<p><strong>Scheduled elements.<\/strong> 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.<\/p>\n\n<p><strong>Scheduled content.<\/strong> 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.<\/p>\n\n<p><strong>Conditional shortcode.<\/strong> For the classic editor, page builders and text widgets: <code>[yangra_conditional role=\"editor\"]\u2026[yangra_conditional_else]\u2026[\/yangra_conditional]<\/code> shows its content only to matching visitors. Build it with Yangra Conditional \u2192 Shortcode builder.<\/p>\n\n<p><strong>Conditions:<\/strong> 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\".<\/p>\n\n<ul>\n<li>Rules are checked on the server: hidden items are never sent to the browser.<\/li>\n<li>\"Preview as\" in the admin bar shows your site as a logged-out visitor, another role or a mobile device.<\/li>\n<li>A Dashboard shows every rule and schedule on your site, with links to where they are set.<\/li>\n<li>\"Copy rule\" and \"Paste rule\" reuse a rule on other menu items, blocks and widgets, across all the editors.<\/li>\n<\/ul>\n\n<h4>Yangra Conditional Pro<\/h4>\n\n<p>Pro adds more conditions and tools to the same editors. Learn more at https:\/\/yangrasoft.com\/yangra-conditional.<\/p>\n\n<ul>\n<li><strong>Condition groups (OR):<\/strong> 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\".<\/li>\n<li><strong>Visitor location:<\/strong> 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.<\/li>\n<li><strong>Visitor language:<\/strong> match the visitor's language, from Polylang or from the visitor's browser.<\/li>\n<li><strong>User groups:<\/strong> make your own lists of users, such as \"Staff\" or \"Wholesale customers\", and use them in rules.<\/li>\n<li><strong>Saved rules:<\/strong> build a rule once and use it in any number of conditional shortcodes; change it in one place.<\/li>\n<li><strong>Countdown:<\/strong> a block and shortcode that count down to a scheduled element's show or hide time.<\/li>\n<li><strong>Preview at a date and time:<\/strong> \"Preview as\" shows your site as it will look at a chosen moment, with its schedules, countdowns and scheduled content.<\/li>\n<li><strong>More for scheduled content:<\/strong> visitor conditions on each item, a history of its cache purges, and a panel on each page that lists the items shown on it.<\/li>\n<\/ul>\n\n<h4>Third-party services<\/h4>\n\n<p>This plugin uses the <a href=\"https:\/\/freemius.com\">Freemius<\/a> 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.<\/p>\n\n<ul>\n<li>Freemius Terms of Service: https:\/\/freemius.com\/terms\/<\/li>\n<li>Freemius Privacy Policy: https:\/\/freemius.com\/privacy\/<\/li>\n<\/ul>\n\n<h4>Source code<\/h4>\n\n<p>The minified JavaScript and CSS in <code>build\/<\/code> are compiled from the human-readable source in <code>assets\/src\/<\/code>, which ships with the plugin, using @wordpress\/scripts (<code>npm run build<\/code>).<\/p>\n\n<p>The plugin includes the <a href=\"https:\/\/github.com\/Freemius\/wordpress-sdk\">Freemius WordPress SDK<\/a> (version 2.13.5, GPLv3) in <code>vendor\/freemius\/wordpress-sdk\/<\/code>, which handles opt-in diagnostics and Pro licensing. Its source is available in that repository.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>yangra-conditional<\/code> folder to <code>\/wp-content\/plugins\/<\/code>, or install it from the Plugins screen.<\/li>\n<li>Activate the plugin through the Plugins screen.<\/li>\n<li>Go to Yangra Conditional in the admin menu to configure it.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20hiding%20a%20menu%20item%20or%20block%20protect%20the%20page%20or%20content%3F\"><h3>Does hiding a menu item or block protect the page or content?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"are%20scheduled%20elements%20protection%3F\"><h3>Are scheduled elements protection?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20page%20caching%3F\"><h3>Does it work with page caching?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"how%20does%20the%20pro%20visitor%20location%20condition%20find%20a%20visitor%27s%20country%3F\"><h3>How does the Pro Visitor location condition find a visitor's country?<\/h3><\/dt>\n<dd><p>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 <a href=\"https:\/\/github.com\/sapics\/ip-location-db\">ip-location-db<\/a>, 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 \u2192 Settings.<\/p><\/dd>\n<dt id=\"how%20does%20the%20pro%20visitor%20language%20condition%20find%20a%20visitor%27s%20language%3F\"><h3>How does the Pro Visitor language condition find a visitor's language?<\/h3><\/dt>\n<dd><p>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).<\/p><\/dd>\n<dt id=\"does%20scheduled%20content%20work%20with%20page%20caching%3F\"><h3>Does scheduled content work with page caching?<\/h3><\/dt>\n<dd><p>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 <code>yangra_conditional_purge_post<\/code> 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.<\/p><\/dd>\n<dt id=\"where%20does%20scheduled%20content%20appear%3F\"><h3>Where does scheduled content appear?<\/h3><\/dt>\n<dd><p>Only in the main content of the pages and posts you choose, through the <code>the_content<\/code> filter: not in archives, excerpts, feeds or the REST API. Page builders that render pages without <code>the_content<\/code> aren't supported, so check pages built with one while an item is active.<\/p><\/dd>\n<dt id=\"which%20menus%20are%20covered%3F\"><h3>Which menus are covered?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20i%20deactivate%20the%20plugin%3F\"><h3>What happens if I deactivate the plugin?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"can%20i%20put%20one%20conditional%20shortcode%20inside%20another%3F\"><h3>Can I put one conditional shortcode inside another?<\/h3><\/dt>\n<dd><p>Yes, up to three levels. WordPress can't put a shortcode inside another with the same name, so use <code>[yangra_conditional_2]<\/code> inside <code>[yangra_conditional]<\/code>, and <code>[yangra_conditional_3]<\/code> inside that. Each has its own \"else\" tag, e.g. <code>[yangra_conditional_2_else]<\/code>.<\/p><\/dd>\n<dt id=\"i%20imported%20my%20content%20into%20another%20site.%20do%20the%20rules%20still%20work%3F\"><h3>I imported my content into another site. Do the rules still work?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Yangra Conditional helps you display and hide content on your site depending on conditions you choose.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/398656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=398656"}],"author":[{"embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/metalfreek"}],"wp:attachment":[{"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=398656"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=398656"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=398656"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=398656"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=398656"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/yor.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=398656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}