Showing WordPress block content to logged-in users is a great way to improve engagement on your WordPress site. There are many possibilities, such as providing discounts to logged-in customers through your WooCommerce store or simply providing access to exclusive content on your blog.
How to display content to logged-in users only
- Make sure Conditional Blocks is active and installed.
- Select the Gutenberg block that you’d like to be visible to logged-in users only.
- In the sidebar on the right, click on Visibility Conditions, open the Condition Builder by clicking configure visibility conditions, and select User Logged In.
The block will now only display for the users that are logged into the site while they are viewing the page. People who are viewing the site without being logged in will NOT be able to see the block and its content.
Tip: Logged in content by user role.
Take logged-in user content one step further by showing block content to users who are logged in AND have a specific WordPress user role.
Read more about User role condition here.