Rescue from the pitfalls of media.

WordPress: Block Visibility Plugin Gives You the Power of a Web Developer

Block Visibility gives you the option to show and hide blocks conditionally. It’s a great tool to expand your collection of WordPress techniques.

Block Visibility Gives You the Power of a Web Developer

Why Use Block Visibility

A regular task in website development is displaying something in one situation and hiding it in another. Until recently, this required coding or perhaps bloatful page builders and plugins. Now the Block Visibility plugin adds this function to WordPress with point-and-click ease. It does so using the native WordPress Block Editor, without bloat and without an intrusive page builder.

Learn about this plugin so you know when to use it as you design, develop, and manage a WordPress site. It’s a great tool to expand your collection of WordPress techniques.

Plugin Documentation is Very Thorough

Block Visibility documentation is thorough, so I’m not including basic how-to information here. The link below has tutorials for getting started, using the variety of controls (19 different ones in April 2025), FAQ, integrations, and settings. Go to this link to learn the basics and the details of using this plugin:

https://blockvisibilitywp.com/knowledge-base

Use Cases and Examples

To demonstrate and foster interest, here are some times when this plugin is very useful.


Templates and Template Parts: Different Headlines on Different Pages

In this example, we experimented with Block Visibility in a template part that’s used on several templates: All Archives, Blog Home, Search Results. The template part includes a Query Loop block with a Post Template block. With this approach, we can edit the Post Template settings and styles for several templates in one place.

However, we want a different headline for each page. Three different headlines are put at the top of the Query Loop block. Each has Block Visibility > Location controls applied.

WordPress template part with multiple headlines with Block Visibility settings.
A template part with three headlines with Block Visibility > Location controls applied.

The first headline is an Archive Title block with these Visibility settings.

  • Visibility Control: Location
  • Show the block if: Archive Type
  • Select condition: Is any of the selected
  • Select Type: Category, Tag, Author (three types selected)

The second headline (Blog Posts) is a Heading block with these Visibility settings.

  • Visibility Control: Location
  • Show the block if: Page Type
  • Select condition: Is any of the selected
  • Select Type: Post Page (Blog page)

The third headline (Search Results) is a Heading block with these Visibility settings.

  • Visibility Control: Location
  • Show the block if: Page Type
  • Select condition: Is any of the selected
  • Select Type: Search Results Page

If you want additional text or images for each page type, that content can be put in Group blocks with the above visibility settings.

A Quick Note on Performance

These Visibility settings require some minimal processing in PHP, so there’s at least a potential for slightly slower pages. I haven’t noticed any issue with performance, but I haven’t lab tested it. Nonetheless, on this site every page except search results is cached. Any minimal performance hit is mostly eliminated by caching. Furthermore, this was an experiment to see if it works. It does.

Putting the headlines on individual templates is a perfectly viable option, too. If performance is critical or becomes an issue with this technique, manage the headlines on individual templates.


Use with Advanced Custom Fields (ACF) and other Plugins

Visibility controls include Advanced Custom Fields, a very useful development plugin itself. Many WordPress sites use ACF. If you use it (free or pro version), you can use Block Visibility with your ACF fields.

In this example, the Obituary custom post type has custom fields including events. We want to display the events section only on obituaries with at least one event.

Web page showing event section to be displayed only when there are events.
On an Obituary custom post type, the Visitation and Services section should appear only when events are associated with the obituary.

On the template Single item: Obituary, we use a container Group block, and use these Block Visibility controls on the block:

  • Visibility Control: Integrations, Advanced Custom Fields
  • Show the block if: Obituary Events (or the custom field you want to use)
  • Select condition: Has any value (or the condition you want to use)
  • This field is associated with: The current post (or the association that applies in your case)
Block editor showing visibility settings for Advanced Custom Fields
Visibility settings for Advanced Custom Fields integration in the Block Editor.

Other Custom Fields, Metadata

Block Visibility has a Metadata control that works with other custom fields created in WordPress or by themes and plugins. You need to know the Meta Key (Name) of the custom field. Read more about the Metadata control here:

https://blockvisibilitywp.com/knowledge-base/how-to-use-the-metadata-control/

Other Plugin Integrations

Block Visibility has integrations for other popular plugins: Easy Digital Downloads, WooCommerce, and WP Fusion. See the plugin integrations page for more information.


Display and Hide Event Info on Selected Dates

The networking group Brandon Biz Pros hosts an in-person social once a quarter. Once the event is over, the event details can be hidden until they are updated for the next quarterly social.

Web page section to be hidden after an event.
The section with event details can be be hidden once the event is over.

To do this, put all the details in a Group block, and use these settings for the block:

  • Block Visibility Control: Date & Time
  • Schedule > From: Now (or beginning date and time you want)
  • Schedule > To: May 1, 2025, 7:00 pm (or the date and time you want)
Block Visibility settings for Date & Time.
Use these Block Visibility settings in the WordPress Block editor.

The Date & Time visibility controls can be used in these cases:

  • sales details
  • event registration or buy buttons that start or end at specific times
  • holiday hours
  • any other time based information

Rewrite a Section and Keep a Copy (plus Page Notes)

When you want to edit a section of content on a page, you can keep a temporary copy of the original and hide it from public view. Follow these steps:

  1. If the content you want to edit isn’t already in a container, put the content in a container block like Group.
  2. Duplicate the container block.
  3. Optional: For an easy way to distinguish the two copies, add a background color to the container you want to hide. For my own convention, I always hide the first and publish the second copy.
  4. Select the container to be hidden.
  5. In the Toolbar Control, click the Options button and click Hide block.
  6. Edit the copy of the block you want to publish.
Block Editor showing where to click Options button and Hide block setting.
After selecting a block, click the Options button and click Hide block. Notice I added an optional green background to the block I want to hide.

Page Notes

This is also a way to hide a section of notes for a page or post.

  1. Add a Group block to the top or bottom of the page.
  2. Optional: Add a background color to the notes block so it’s easy to distinguish from other blocks.
  3. Add any notes you have for the page.
  4. Select the container block.
  5. In the Toolbar Control, click the Options button and click Hide block.

Other Uses of the Hide Block Control

The plugin documentation has similar suggestions on using the Hide block control for incomplete blocks while you edit a page. See more at this link:

https://blockvisibilitywp.com/knowledge-base/how-to-use-the-hide-block-control/


A Caveat

This warning is about WordPress in general, not this plugin.

There’s a non-zero chance that the plugin could be accidentally disabled or removed, or it could fail with an update or activation of another plugin. If this ever happens, all hidden blocks could become visible to the public. I don’t know of this happening with Block Visibility, but careless admins have done such things, and sometimes plugins conflict. Be aware of this possibility.

I wouldn’t try to secure highly sensitive information with WordPress without extra security plugins and precautions. If you need to publish sensitive information conditionally, get a thorough review by and the advice of a WordPress security expert. And take extra care when updating WordPress and plugins.

Conclusion

Block Visibility is a very useful and practical WordPress plugin that gives point-and-click users some of the powers only coders used to have. The examples provided here are just the beginning. They’re included to show some of what you can do with the plugin and to foster your interest.

Many WordPress designers and developers can benefit from this plugin. Learn what it can do so you’ll have its functions in your collection of WordPress techniques.


If this helps, or you have a question or comment, please let us know. We don’t have comments on because… you know… spammers. But we’d love to hear from you.

Send us a message if you have a comment.

Dave Loebig

More About Dave Loebig

About Pacesetter Media

Over 25 years’ experience in web design, media production, graphic design, business communications, printing, and promotion.

  • web design
  • WordPress
  • Wix, Weebly, Square and others
  • graphic design
  • photography and photo retouch
  • social media
  • printing
  • promotional items
  • signs and banners
  • direct mail