Do you want to hide certain WordPress blocks from a user role?
The WordPress content editor offers a lot of flexibility in creating content using blocks. However, you may want to disable some blocks for different user roles. This is helpful if you run a multi-author website or don’t want others to access specific blocks.
In this article, we will show you how to hide blocks from specific users in the WordPress content editor.
Why Hide Blocks from Specific Users in the Content Editor?
WordPress blocks (or Gutenberg blocks) are content elements you add to your blog post or page, including images, videos, texts, and more. Many WordPress plugins also add blocks to the content editor.
To maintain content consistency and streamline your editorial workflow, it can be beneficial to hide or disable certain blocks based on user roles.
For example, you might hide the tables block for authors and contributors to avoid clutter. Or, restrict access to plugin-specific blocks like WPForms to control where you can place forms in your WordPress theme.
That said, let’s see how to hide or disable blocks for specific users on your WordPress website.
Hiding Blocks from Specific Users in WordPress Editor
The best way to manage your block visibility based on user roles is by using the PublishPress Blocks plugin. It gives you more control over the WordPress block editor and adds more blocks like an image slider, search bar, pricing table, and more.
First, you’ll need to install and activate the PublishPress Blocks plugin. The free version has a good set of features for this tutorial, but feel free to upgrade to the Pro version to get more advanced tools.
If you need help with the plugin installation, then please see our guide on how to install a WordPress plugin.
Once installed, you can head to the Blocks » Block Permissions plugin settings from the WordPress dashboard.
Then, you can choose a user profile whose block permissions you’d like to modify from the dropdown menu at the top.
To hide a block from the selected user role, simply click the toggle to disable it.
For example, in the image below, we will disable the ‘Heading’ and ‘Quote’ blocks for any user with the Author role.
Don’t forget to click the ‘Save Block Permissions’ button when you’re done.
Additionally, you can click ‘Enable or disable all blocks’ to activate or deactivate all of the blocks at once for a specific user role. This feature may come in handy if the user is not supposed to deal with editing your post or page content, like a comment moderator.
That’s it! You’ve successfully disabled the block for a user role on your WordPress site. Now, you can repeat this to hide or show blocks for other WordPress user roles.
Learn More Ways to Manage User Roles and Permissions
Besides hiding specific content blocks from certain user roles, there are many ways you can make managing your users and permissions much easier. Here are some tutorials for you to get started:
- Free User Management Plugins for WordPress
- How to Add New Users and Authors to Your WordPress Blog
- How to Add or Remove Capabilities to User Roles in WordPress
- How to Allow Editors to Only Edit Certain Pages in WordPress
- How to Limit Authors to Their Own Posts in WordPress Admin
- How to Let Contributors Edit Their WordPress Posts After Being Approved
- How to Force Logged-in Users to Log Out in WordPress
We hope this article helped you learn how to hide blocks from specific users in the WordPress editor. You may also want to see our guide on how to increase your blog traffic and our comparison of the best managed WordPress hosting.
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.
Syed Balkhi says
Hey WPBeginner readers,
Did you know you can win exciting prizes by commenting on WPBeginner?
Every month, our top blog commenters will win HUGE rewards, including premium WordPress plugin licenses and cash prizes.
You can get more details about the contest from here.
Start sharing your thoughts below to stand a chance to win!