PageForge 1.3: check every run before it writes, update generated pages, spintax and resumable batches. See what changed
Account Get it free
If Shortcode icon
Possibly abandoned Tested up to 6.6.12 #12 in conditional

If Shortcode

This plugin provides an [if] shortcode to conditionally render content. The syntax is the following:

Active installs100+100+ tier
Downloads · 30d149▲ +40.6% vs prev. 30d
Rating5/56 reviews
Health score26/100At risk
All-time downloads5.5KSince Mar 2014
Support resolved0 / 10% in last 2 months
RequiresWP 3.0.1PHP 5.4+
Downloads · 7d42▲ +61.5% week over week
Our verdict

Consider an alternative

If Shortcode shows warning signs in 2026 — compare the alternatives below before installing. It runs on 100+ sites, is rated 5/5 and was last updated 2 years ago, and scores 26/100 on our health check.

  • Small user base (100+ active installs)
  • No update in 2 years
  • Only tested up to WordPress 6.6 (latest is 7.1)

How does it stack up?

Side-by-side on installs, updates, ratings & support

Daily downloads

369Aug 25Oct 8Nov 22
Yesterday4
Daily average (1y)2
Peak day13Oct 19, 2026
Last 12 months781

Download spikes usually follow a new release — each site that auto-updates counts as a download.

Rankings

Where If Shortcode stands today

WordPress.org search rankings

Live position in the plugin search, top 100
KeywordPositionCompeting pluginsCategory
conditional >100 2,924 Best conditional plugins →
conditional-tags >100 1,535 Best conditional-tags plugins →
else >100 5,814 Best else plugins →
if >100 0 Best if plugins →
shortcode >100 10,000 Best shortcode plugins →

Version adoption

Share of active sites per release.

  • 0.378.8%
  • 0.221.2%

Rating breakdown

★★★★★★★★★★ 5 from 6 reviews

  • 5★100.0%
  • 4★0.00%
  • 3★0.00%
  • 2★0.00%
  • 1★0.00%

About If Shortcode

From the official readme · v0.3.0

Description

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 also provides an [else] shortcode and an [eitherway] one for use inside [if] blocks. [else] will render its content if the condition evaluates to false, and [eitherway] will render its content regardless of the evaluation result.
When used outside an [if] block, these shortcodes behave as if the whole content is surrounded by an [if] shortcode whose condition evaluates to true. In other words, an [else] shortcode would not render any content, while a [eitherway] one would. You can use as many of these shortcodes as you like in a single [if] block, which gives you the ability to do things like:

    - Am I logged in?
    [if is_user_logged_in]- Yes you are.
    [else]- No you are not.
    [/else][eitherway]- I'm sorry, what?
    [/eitherway]- I said YOU A-R-E LOGGED IN!!!
    [else]- YOU ARE NOT LOGGED IN!!! What's the matter with you?[/else][/if]

A multitude of conditions are supported out-of-the-box. The following evaluate to the result of the corresponding WordPress Conditional Tag, using the no-parameter syntax:

    is_single
    is_singular
    is_page
    is_home
    is_front_page
    is_privacy_policy
    is_attachment
    is_category
    is_tag
    is_tax
    is_author
    is_archive
    is_year
    is_month
    is_date
    is_day
    is_time
    is_feed
    is_search
    is_sticky
    is_preview
    has_term
    has_excerpt
    comments_open
    pings_open
    is_404
    is_user_logged_in
    is_super_admin
    is_multi_author
    is_multisite
    is_main_site
    is_child_theme

For example, the evaluation of the is_page condition is equivalent to calling is_page() with no parameter.

Extending

The functionality of the plugin can be extended by other plugins, by means of adding custom conditions through filters. To add a custom condition, a filter hook must be defined in the following manner:

add_filter($if_shortcode_filter_prefix.'my_condition','my_condition_evaluator');

function my_condition_evaluator($value) {
    $evaluate=.... /* add your evaluation code here */
    return $evaluate;
}

Then, you can use your custom condition like so:

[if my_condition]{content}[/if]

A big thanks to M Miller for the normalize_empty_atts() function.

Installation

Install the plugin using the usual method described in the codex.

Changelog

0.3.0

  • Improvement: Refactored code for PHP 5.4+
  • Addition: Added some more tags

0.2.1

0.2.0

  • Addition: [else] shortcode
  • Addition: [eitherway] shortcode

0.1.0

  • First release.

Full changelog on WordPress.org →

For developers

Is this your plugin? Show off the numbers.

Add a live badge to your site, docs or GitHub README. It updates on its own — no account needed.

Active installs badge Rating badge Health score badge

Best If Shortcode alternatives

All conditional plugins →
Alternatives
Rank Plugin Active installs Rating Updated Health
1 Dynamic Visibility for Elementor Dynamic Visibility for Elementor Show or hide Elementor widgets, containers, columns, and pages based on user role, date… by Dynamic.ooo 50K+ ★★★★★★★★★★ 4.6 (89) 1 month ago 74
2 Ele Conditions for Elementor Ele Conditions for Elementor Add interactive triggers and conditional display logic to any Elementor element — show… by dudaster 2K+ ★★★★★★★★★★ 4.2 (5) 7 months ago 52
3 Content Visibility for Divi Builder Content Visibility for Divi Builder Content Visibility for Divi Builder. by Jonathan Horowitz 2K+ ★★★★★★★★★★ 4.8 (101) 2 months ago 67
4 Conditional Logic Emails, Fields, Redirect for Elementor Forms Conditional Logic Emails, Fields, Redirect for Elementor Fo… Show and hide fields. Send certain email, don't send others. Redirect to one of many pages… by add-ons.org 2K+ ★★★★★★★★★★ 4.3 (12) 2 months ago 76
5 Simple Image Popup Simple Image Popup A simple way to show a popup image on your website with various enhancements including… by mrdigital 1K+ ★★★★★★★★★★ 5 (3) 2 years ago 37
6 If-So Conditional Content for Elementor If-So Conditional Content for Elementor Conditional Logic for Elementor. No setup or coding required. Fully compatible with any… by If-So Dynamic Content 1K+ ★★★★★★★★★★ 5 (1) 3 months ago 73
7 Extra Shipping Rates for WooCommerce Extra Shipping Rates for WooCommerce Easily set shipping rates based on a variety of conditions to match your business… by Viszt Péter 1K+ ★★★★★★★★★★ 5 (3) 3 weeks ago 66
8 Menu Visibility Control Menu Visibility Control Control WordPress menu item visibility based on login status, user roles, device type, or… by Davis Simiyu Wanyonyi 700+ ★★★★★★★★★★ 5 (3) 1 month ago 77
9 Block Logic – Full Block Display Control Block Logic – Full Block Display Control Block Logic adds a "Block Logic" field to the block editor, that lets you show or hide any… by landwire 300+ ★★★★★★★★★★ 5 (13) 6 months ago 55
10 Display During Conditional Shortcode Display During Conditional Shortcode Show or hide content based on date ranges, recurring day/time schedules, or custom… by Gabriel Serafini 200+ ★★★★★★★★★★ 5 (3) 1 month ago 72

FAQ

If Shortcode: quick answers

Straight answers, pulled from live WordPress.org data.

Source: WordPress.org

Is If Shortcode free?

Yes. If Shortcode is free to download and use from the official WordPress.org plugin directory.

Is If Shortcode safe to use in 2026?

If Shortcode shows warning signs in 2026 — compare the alternatives below before installing. It runs on 100+ sites, is rated 5/5 and was last updated 2 years ago, and scores 26/100 on our health check.

How many websites use If Shortcode?

If Shortcode is active on 100+ WordPress websites and has been downloaded 5,492 times since it launched in March 2014. It was downloaded 149 times in the last 30 days.

Does If Shortcode work with WordPress 7.1?

If Shortcode is officially tested up to WordPress 6.6.12, while the latest release is 7.1.5. It may still work, but try it on a staging site first.

What PHP version does If Shortcode need?

If Shortcode requires PHP 5.4 or higher. Most hosts run PHP 8.x today, so it works on any modern WordPress hosting.

When was If Shortcode last updated?

The latest version, 0.3.0, was released on August 2, 2024 (2 years ago).

Who makes If Shortcode?

If Shortcode is developed and maintained by geomagas.

What are the best alternatives to If Shortcode?

The most popular alternatives to If Shortcode are Dynamic Visibility for Elem… (50K+ installs), Ele Conditions for Elementor (2K+ installs) and Content Visibility for Divi… (2K+ installs).

Powered by PageForge

One template and a spreadsheet. A real page for every search.

PageForge turns each row of a CSV into a WordPress page with its own title, URL, SEO fields and schema, built on the layout you already designed. Free on WordPress.org.

  • CSV and XLSX, plus Google Sheets on Professional and Enterprise
  • Its own title, URL, SEO fields and schema for every page
  • Works with the block editor, Elementor, Divi and Avada
  • Free on WordPress.org, no credit card

↑↓ to move↵ to open