Restricting Visibility of WordPress Widgets

Widgets often contain content that is not meant for everyone — member downloads, account links or promo banners aimed only at new visitors. With Restrict for WordPress you can restrict WordPress widgets so that each one appears only to visitors who meet the criteria you choose. This guide walks you through setting widget visibility by login status, user role or capability, without writing a single line of code.

Why control widget visibility?

Sidebars and footers appear on many pages at once, so a single widget can be seen practically everywhere on your site. Setting the visibility of that widget in one place instantly applies across every page where its widget area is displayed — which makes widget restriction one of the quickest wins when building a members-only experience.

Some common use cases:

  • Members-only resources – show a downloads or quick-links widget only to logged-in members.
  • Role-based announcements – display notices only to a specific user role, such as students or subscribers.
  • Smarter promotion – show a "Join now" banner only to logged-out visitors, and hide it from people who already signed up.
  • Login shortcuts – display a login widget to logged-out users only.

Prerequisites

  • Restrict for WordPress installed and activated on your website.
  • A theme with at least one widget area available under Appearance → Widgets. Restrict works with any WordPress theme that uses standard widget areas.

How to restrict WordPress widgets

With Restrict installed and activated, it is very easy to restrict the visibility of WordPress widgets. When adding a new or editing an existing widget within any widget area of your website, you can select which criteria are required for the widget to appear:

  1. Go to Appearance → Widgets in your WordPress admin.
  2. Add a new widget to any widget area, or expand an existing one to edit it.
  3. Restrict adds a visibility setting to every widget.
  4. Select the criteria required for the widget to appear, then save the widget.

Widget visibility criteria added by Restrict for WordPress on the widget editing screen

Available visibility criteria

By default, the setting is Everyone, which means the widget will be visible and accessible to all visitors of your website. If you want the widget to be visible only to certain users, these are the remaining available criteria:

  • Logged in users – the widget will be visible to all logged-in users
  • Users with specific role – select the specific user role required for the widget to display
  • Users with specific capability – select the specific user capability required for the widget to become visible
  • Logged out users – if this option is selected, the widget will be visible to logged-out users

Each widget carries its own setting, so you can mix criteria within the same sidebar. A classic combination: a login widget shown only to logged-out visitors sitting right above a members-links widget shown only to logged-in users — every visitor sees exactly one of the two.

More criteria with WooCommerce, Tickera and Easy Digital Downloads

Additional options will be available as criteria if you have Tickera, WooCommerce or Easy Digital Downloads installed on your website, letting you show widgets only to customers or ticket buyers. For more information, please check our Integrations documentation.

Tips and troubleshooting

  • Restrict the destination too. A hidden widget keeps links out of sight, but it does not protect the pages it links to. Combine widget restriction with page and post restriction so direct URLs stay protected as well.
  • Make navigation consistent. Pair widget visibility with restricted menu items so your whole site adapts to who is viewing it.
  • Test with different users. Check the site in a private/incognito window and with a test account for each role you target.
  • Mind your cache. Full-page caching can serve the same widgets to everyone. Configure your caching plugin to bypass logged-in users or clear the cache after changing widget settings.

Related documentation