The Block Visibility feature lets you show or hide any block on the front end based on ACF field values. It works on any block — not just ACF Field blocks — so you can use it on a Group, a Heading, a Cover, a third-party block, or one of the plugin’s own Text / Image / Button blocks.
The feature is inspired by ACF’s own Conditional Logic for fields (where, in the field group editor, you can say “only show this field if another field equals X”). Block Visibility brings the same idea to the block editor: pick a field, pick a comparison, give it a value, and the block appears only when the rule passes.
How to use it
- Select any block in the editor.
- In the block sidebar, open the Visibility by ACF panel.
- Toggle Enable Conditional Visibility on.
- Click Edit Visibility Rules to open the rule editor.
- Build one or more rules (described below), then click Save Rules.
On the front end, WordPress evaluates the rules whenever it goes to render the block. If the rules pass, the block renders as normal. If the rules fail, the block renders nothing — no empty <div>, no error, no fallback HTML.
Inside the editor the block is always visible, regardless of its visibility rules. That way you can still see and edit the block even if its rules currently evaluate to “hidden” for the post you’re editing. The rules only take effect on the public-facing front end.
How rules work
The rule editor is titled “Show this block if:” because that’s exactly what your rules say — the block is shown when they pass, hidden when they don’t.
Rules are organized into rule groups, which combine like this:
- Within a rule group, all rules must pass (AND).
- The block is shown if at least one rule group passes (OR).
That’s the same shape as ACF’s own conditional logic.
What each rule looks like
Every rule has four parts:
| Part | What it picks |
|---|---|
| Field Source | Where the field’s value comes from — Current Post, Current User, Options, a specific post, etc. The same sources used elsewhere in the plugin (see Field Sources). |
| Field | Which ACF field on that source the rule reads. |
| Comparison | How the field’s value is compared (equals, contains, is empty, etc.). The list of comparisons available adapts to the field type. |
| Value | The value to compare against. Some comparisons don’t need this — for example Has any value, Is checked, Is unchecked. |
Available comparisons
| Field type | Available comparisons |
|---|---|
| Text, Text Area, Email, URL, Password | Has any value, Has no value, Equals, Not equals, Matches pattern, Contains |
| Number | Has any value, Has no value, Equals, Not equals, Less than, Greater than |
| Range | Has any value, Has no value, Equals, Not equals, Contains, Less than, Greater than |
| WYSIWYG | Has any value, Has no value, Matches pattern, Contains |
| oEmbed | Has any value, Has no value, Contains |
| Image, File, Link | Has any value, Has no value |
| Select (single) | Has any value, Has no value, Equals, Not equals |
| Select (multi), Checkbox | Has any value, Has no value, Contains, Does not contain, Less than (count), Greater than (count) |
| Radio, Button Group | Has any value, Has no value, Equals, Not equals |
| True / False | Is checked, Is unchecked |
| Post Object (single), Page Link (single), Taxonomy (single), User (single) | Has any value, Has no value, Equals, Not equals |
| Post Object (multi), Page Link (multi), Relationship, Taxonomy (multi), User (multi) | Has any value, Has no value, Contains, Does not contain, Less than (count), Greater than (count) |
| Google Map, Date Picker, Date Time Picker, Time Picker, Color Picker, Icon Picker | Has any value, Has no value |
| Repeater | Has any value, Has no value, Less than (row count), Greater than (row count) |
A few terms to know:
- Has any value / Has no value — checks whether the field is filled in (in the same sense ACF uses for “empty”). Particularly useful when you want a block to appear only on posts that opted into a feature.
- Matches pattern — runs the field value through a regular expression. Example pattern:
^https://example\.com/. Use it sparingly; the rule is evaluated server-side on every page render. - Contains / Does not contain — for text fields, checks for a substring; for multi-value relationship-like fields, checks whether the selected list includes the given entry.
- Less / Greater than — for Number / Range fields, a numeric comparison; for multi-value fields and Repeater, a comparison against the number of selections / number of rows.
- Is checked / Is unchecked — True / False only.