As of April 2026, If Shortcode is a WordPress if plugin with 200 active installations and a 5/5 rating from 6 reviews. It has been downloaded 4.9K+ times in total. Requires WordPress 3.0.1+ and PHP 5.4+. Available on WordPress.org since 2014. Last updated 1 year ago — may have compatibility concerns. Top alternative: VK Dynamic If Block.
This plugin provides an [if] shortcode to conditionally render content. The syntax is the following:
[if condition1 condition2=false condition3]{content}[/if]
Conditions are passed as attribute names. Multiple conditions evaluate to the result of ORing all of them. In other words, if at least one condition evaluates to the desired boolean result, {content} is rendered, otherwise it is discarded.
Attribute values determine if we want the condition to be true or false. A value of '0', 'false', '' (the empty string), 'null' or 'no' means we expect the condition to be false. Anything else, including the absense of a value, is interpreted as true.
For example, suppose that we want to include a sentence in a post, but only for anonymous visitors:
[if is_user_logged_in=no]The Sentence.[/if]
It…
| WordPress | 3.0.1+ requiredTested up to 6.6.5 |
| PHP | 5.4+ required |
Plugin data sourced from WordPress.org. Analysis and metrics by PluginSift.