How to Add Conditions to WordPress Blocks

TL;DR: Select any block → Click “Configure Conditions” in the sidebar → Pick a condition → Done. That’s it.


Quick Start (60 Seconds)

Already comfortable with WordPress? Here’s the fast version:

  1. Select a block — any block works (paragraphs, images, groups, buttons)
  2. Find “Conditional Blocks” in the right sidebar panel
  3. Click “Configure Conditions” — opens the condition builder
  4. Pick a condition from the dropdown
  5. Save your post

Your block now shows or hides based on your condition.

Want to see it in action first? Try the interactive demo — no install required.


Your First Condition: A Walkthrough

Let’s do something practical. Say you want to show a “Members Only” banner to logged-in subscribers but hide it from everyone else.

Step 1: Select Your Block

Click on the block you want to control. This works with any block — paragraphs, images, buttons, groups, or even reusable blocks.

For this example, select your “Members Only” banner.

Step 2: Open the Condition Builder

Look at the right sidebar. You’ll see a “Conditional Blocks” panel. Click Configure Conditions.

This opens the Condition Builder.

Step 3: Add a Condition

Click the dropdown and select User Role. You’ll see options for different WordPress roles (Administrator, Editor, Subscriber, etc.).

Set it to show only for Subscriber (or whatever role your members use).

Step 4: Save and Test

Publish or update your post. Now:

  • Logged-out visitors see nothing
  • Subscribers see the banner
  • Other roles (depending on your settings) see nothing

That’s your first condition. Takes about 30 seconds once you’ve done it once.


Combining Conditions (AND / OR)

Single conditions are useful. Combined conditions are powerful.

AND = All Conditions Must Match

Use AND when you need multiple things to be true at the same time.

Example: Show a block only to subscribers on desktop devices

  1. Add the User Role condition → set to Subscriber
  2. Click the AND button
  3. Add the Responsive condition → toggle only Desktop

Result: A subscriber on mobile won’t see the block. A subscriber on desktop will. A non-subscriber on desktop won’t.

All conditions must be true.

OR = Any Condition Can Match

Use OR when you want alternative triggers.

Example: Show a discount to WooCommerce customers OR newsletter subscribers

  1. Add WooCommerce Customer condition → set to “Has Purchased”
  2. Click the OR button (creates a new condition set)
  3. Add User Role condition → set to Subscriber

Result: Anyone who’s bought something sees the discount. Anyone who’s a subscriber also sees it. They don’t need to be both.

Either condition triggers the block.


10 Things You Can Build Today

Here’s what other users are doing with Conditional Blocks:

What You WantConditions to Use
Black Friday banner (Nov 24-27 only)Date Range
“Welcome back!” message for return visitorsCookies
Hide prices from logged-out usersUser Logged In
Show shipping notice only in CaliforniaGeolocation (Country/Region)
Members-only video for paid subscribersUser Role
Different CTAs for mobile vs desktopResponsive
Show upsell only when cart > $50WooCommerce Cart Value
Display content only on specific pagesPost IDs
Personalized greeting using UTM parametersQuery Strings
VIP discount for customers who spent $500+WooCommerce Total Spent

Mix and match with AND/OR to get exactly what you need.


Common Starter Conditions

Not sure where to start? Try these first:

User Logged In / Logged Out

Show different content to logged-in users vs visitors. Great for membership teasers, login prompts, or personalized messages.

User Role

Target specific WordPress roles — Subscribers, Customers, Editors, etc. Perfect for tiered content or role-based messaging.

Date Range

Schedule content to appear and disappear automatically. Set up your holiday sale in October, forget about it, let it run itself.

Responsive (Screen Sizes)

Show or hide blocks based on device. Desktop-only signup forms. Mobile-only sticky CTAs. You get the idea.

Geolocation

Display content based on visitor location (country or continent). Run region-specific promotions without creating separate pages.


Pro Features Worth Knowing

These features speed up your workflow:

Preset Manager

Create a condition setup once, reuse it across your entire site. Changed your “Members Only” logic? Update the preset and it updates everywhere.

Learn about Preset Manager →

WooCommerce Integration

Goes way beyond “is customer.” Check cart value, products in cart, purchase history, customer lifetime spend, and more.

See WooCommerce conditions →

Custom Conditions API

Developers can register their own conditions. If you can write a PHP function that returns true/false, you can make it a condition.

Developer documentation →


Working with Caching

Quick heads up: if you’re using a caching plugin (WP Rocket, W3 Total Cache, etc.), some conditions need special handling.

User-based conditions (logged in/out, user role) work best when you exclude those pages from caching — or use the plugin’s logged-in user cache separation.

Full caching guide →


Next Steps

You’ve got the basics. Here’s where to go from here:

Questions? Check the FAQ or troubleshooting guide.

Was this page helpful?