
WBD Conditional Blocks adds a “Conditional Visibility” panel to the settings sidebar of every block in the WordPress block editor — not just a special block of its own. Turn it on, add one or more conditions, choose AND/OR logic, and the block will only render for visitors who match your rules. Everything in this plugin is free.
Why WBD_Conditional_Block
- Works on any block. Paragraphs, images, buttons, columns, WooCommerce blocks, third-party blocks — if it’s a Gutenberg block, it can be made conditional.
- Lightweight. No bloated block library, no page builder — just the visibility layer, on top of the blocks you already use.
- Everything is free. Every condition type below, AND/OR logic, analytics, and A/B testing are included at no cost.
Condition types
- Login Status — logged in vs. logged out
- User Role — Administrator, Editor, Subscriber, WooCommerce Customer, or any custom role
- Device Type — Mobile, Tablet, Desktop
- Date/Time — a specific date range, or a recurring day of the week (with optional time window) — great for countdowns and limited-time sales
- Page/Post Type — front page, blog index, search results, 404, any archive, specific post types, or specific posts/pages by name
- Geolocation — show content to visitors from specific countries (uses a CDN header when available, e.g. Cloudflare, with a cached free API fallback)
- Browser — Chrome, Firefox, Safari, Edge, Opera
- Operating System — Windows, macOS, Linux, iOS, Android
- Referrer URL — traffic from Google, Facebook, direct visits, or any custom domain
- Query String — show content when a URL parameter is present (e.g.
?source=facebook) - Cookies — match a visitor’s cookie name/value (e.g. “has visited before”)
- WooCommerce — cart contents, cart value, purchase history, lifetime spend, guest vs. customer
- Custom Fields — ACF field values, or plain post meta
- Language — the site’s active locale or the visitor’s browser language
- A/B Test Variant — randomly (and consistently) split visitors 50/50 between two versions of a block, then compare performance in the built-in analytics
AND / OR logic
Combine multiple conditions on one block and choose whether all of them must match (AND) or any of them (OR).
Conditional Group block
Need to hide several blocks together, or wrap content that doesn’t have its own settings panel? Add the Conditional Group block, drop any blocks inside it, and apply one rule set to the whole group.
Built-in analytics
Every conditional block reports how many times it was shown vs. hidden. View daily trends and per-block totals — including the A/B variant split — from WBD_Conditional_Block Analytics in your dashboard. No data leaves your site.
White-label
Rename the plugin’s dashboard menu and pages to your own brand from WBD_Conditional_Block Settings — handy for agencies building on client sites.
Development
Public source code repository:
https://github.com/wpbranddigital/wbd-conditional-block
Build Instructions:
- npm install
- npm run build
- npm run start (development)
WBD Conditional Block is built using @wordpress/scripts.
External services
This plugin connects to a free external geolocation API (ip-api.com) to determine a visitor’s country when the “Geolocation” condition is used.
It sends the user’s IP address to the API to obtain their country code, allowing the block visibility rules to work. The results are cached per IP to minimize requests. This service is provided by Artia International (ip-api.com).
Please review their Terms of Service and Privacy Policy.