I just found myself looking for a plugin that would allow conditions on blocks, e.g., to hide some blocks to logged-in users or on specific screen sizes.
I went through the options of 4 plugins and decided to share my notes on them.
I was looking at two specific things: how do they implement the block options and if they also work with the block editor for widgets that is going to be shipped with WordPress 5.8. I tested using the appropriate feature through the Gutenberg plugin version 10.7.1.
The order is based on which one I found first through search on wordpress.org.
According to their active installs on wordpress.org, Conditional Blocks is the most widely used plugin I tested. However, even their 1000+ active installs show that this topic is still a niche.
The free version of Conditional Blocks comes with a condition to show blocks based on the screen size or state, i.e., logged-in vs. out. A lot more options and settings come with the hard-promoted Pro version.
What also stands out is that the options show up in a modal instead of with the block settings. I don’t mind that, it just stood out.
The current version 2.0.1 does not work with the widget block editor.
Block Visibility is the most feature-rich and eye-pleasing plugin I tested. The block settings look like other native block options, and there are many general customizations, including which visibility options are available at all.
More than 800 active installs and the most positive ratings on wordpress.org support my positive impression.
My main concern for heavy usage on long-term projects would be a missing Pro version. With the block API changing more often than the “old” WordPress core did, I am wondering how long the author Nick Diego can or will maintain it.
While seeing how powerful the plugin is, I was surprised that it doesn’t support the new widget editor.
Update June, 7th: the changelog of the free version on wordpress.org indicated an upcoming Pro-version without a specific release date.
Wicked Block Conditions
With just 30+ active installs, Wicked Block Conditions is still small. This is surprising since it is around since last year. I have not found a reason within the plugin or reviews. It might just be the curse of a new plugin.
In my option, Wicked Block Conditions manages well to add many conditions in the limited space of block options.
Wicked Block Conditions was also the first of the tested plugins that worked with the block widget editor. So if that were my main criteria, then I would definitely go with it.
Funny though, that the block conditions work for widgets.
All of the tested plugins have some option to remove blocks based on devices or screen size. Practically, they used CSS to hide the loaded content. If the last grain of performance scores is important to you, then this technology is rather unfortunate. On the other hand, it makes conditions work on cached sites as well.
If performance matters and you are using caching then you should test the plugins on this page carefully.