Restrict Widgets

Take full control over your widgets! Select on which pages each widget will appear on, who can manage widgets and which widgets and sidebars users can use.

Restrict Widgets is all in one solution for widget management in WordPress. It gives every widget an extra control fields that lets you control the pages that the widget will appear on. This plugin creates a new “manage_widgets” capability, that allows you to gives access to widgets page to selected WordPress user roles. You can also set which sidebars and widgets will be available to selected users, which widget options will be available and how it will be displayed.

By default, ‘Hide widget on selected’ is enabled with no options selected, so all current widgets will continue to display on all pages.

Features include:

  • Hide or display each widget on selected pages, posts, categories, custom taxonomies, custom post types, single posts, archives, special pages, for logged in or logged out users, current language and so on
  • Restrict Users – select which user roles are restricted to manage widgets
  • Restrict Sidebars – select which sidebars will be restricted to admins only
  • Restrict Widgets – select which widgets will be restricted to admins only
  • Restrict Widget Options – select which widget options will be restricted to admins only
  • Restrict Option Groups – chose to display or not widget options as groups
  • WPML compatibility
  • Polylang compatibility
  • .pot file for translations included
  • 1.3.0
  • Option to enter post ID's where widget should be displayed/hidden -
  • Fields overlapping JS bug
  • Option to select "post" post type only
  • Call to undefined function bbp_is_search()
  • PHP Warnings for array_keys() and in_array() on Multisite install
  • Create separate menu for Restrict Widget settings
  • 1.2.0
  • Multisite compatibility
  • Add bbPress options - search and user profiles
  • get_class() error
  • Add option for mobile devices
  • 1.1.0
  • Widget options not saving if no options selected (since 1.0.1)
  • Add hooks to display / hide widget based on custom conditions
  • Restricting on user_logged_in/out doesn't work
  • Show on selected not working
  • 1.0.0
  • Inital release

Leave a Reply

Your email address will not be published. Required fields are marked *

33 comments on "Restrict Widgets"

  1. I needed to replace the plugin “Display Widget” which is no longer “well” supported.
    I found Restricted Widgets and will use it now on the blog of which is a webradio.
    Look great so far. Thanks

  2. in this link >>> ?????

    • Yes, exactly. You’ll find a RW support forum there.

  3. I use version 1.2.3 and have problem when i set to hide widget on laptop or desktop. When i open my website on laptop the widget still run.

    I was change setting to “Display widget on selected ” >>> mobile but if i open in laptop/desktop that widget still run..

    I Use the latest version WordPress.

    • Please post this in a plugin dedicated support forum.

  4. Hi,
    in my site i need to restrict widget for category page. Plugin work properly only after editing the file restrict-widgets.php in this way:

    elseif(is_page()) {
    $found_main = isset($instance[‘rw_opt’][‘pageid_’.$post_id]) ? TRUE : FALSE;

    /* FM */
    $post = $wp_query->post;
    $categs= get_the_category( $post->ID );
    $categ = $categs[0];
    $catprop = ‘category_’.$categ->term_id;

    if (isset($instance[‘rw_opt’][$catprop])) {
    $found_main = isset($instance[‘rw_opt’][$catprop]) ? TRUE : FALSE;
    $found_main = isset($instance[‘rw_opt’][‘cpt_’.get_post_type($post_id)]) ? TRUE : FALSE;

    if(is_single() && $found_main == FALSE)
    $found_main = isset($instance[‘rw_opt’][‘others_single_post’]) ? TRUE : FALSE;

    /* FM */
    $post = $wp_query->post;
    $categs= get_the_category( $post->ID );
    $categ = $categs[0];
    $catprop = ‘category_’.$categ->term_id;

    if (isset($instance[‘rw_opt’][$catprop])) {
    $found_main = isset($instance[‘rw_opt’][$catprop]) ? TRUE : FALSE;
    elseif(is_category()) {
    /* FM */
    //$found_main = isset($instance[‘rw_opt’][‘category_’.get_query_var(‘cat’)]) ? TRUE : FALSE;
    $post = $wp_query->post;
    $categs= get_the_category( $post->ID );
    $categ = $categs[0];
    $catprop = ‘category_’.$categ->term_id;
    $found_main = isset($instance[‘rw_opt’][$catprop]) ? TRUE : FALSE;

    otherwise the widgets were not filtered.

  5. Hello. I cannot figure how to get a widget to ONLY show on ONE SPECIFIC Post (as opposed to Page)…. the dropdown menu in the widgets screen only lists published Pages, not published Posts

  6. Hi. I had been using the plugin for a few months with no problems. After upgrade to v1.2.0, nothing works on the widget page. Can’t drag widgets to the sidebars, or open any widgets on the sidebar to set “hide/show.” Would like this to work because it’s a great plugin.

    • Larry, please post this as a support topic – we’ll need some more details.

      • Thanks, Bartosz. I opened a topic about it in the support section.

  7. Hi, was wondering if you had a timeline for when this excellent-sounding plugin will work with WP multi-site. I really don’t see much reason to have a plugin installed that restricts user access to site widgets if they don’t even have access to them, anyway. I mean, blog visitors don’t have access to an admin’s control panel, anyway. So it seems to me that the natural use for this plugin WOULD BE to control user access to plugins on a multi-site platform.

    As such, it seems really strange to me that it isn’t yet multi-site compatible.

    Would you be able to give an indication of when this plugin will be compatible with multi-site? I have a bit of time yet before my site goes live and if it will be ready by then, I’d like to use this plugin. If it’s not ready by then, I should start looking for something compatible now, I’m afraid.


    • Don’t worry – upcoming update will include multisite support.

      • Hi Bartosz,

        Thanks for the reply. What I was wondering, though, is if you have a DATE for the next release, then, so that I can determine whether I can wait for this plugin’s next version or if I’ll have to find something else because the new update won’t be ready until after I launch my website.

        I’m trying to determine a timeline of events so that I can determine if I can build the site with the components I WANT or whether I’ll have to use components that are not necessarily ideal.

        So that is why I’m trying to figure out a DATE (or at least a proposed time period, like “last week of December” or something) for when it will become available for multisite.

        If you could provide this info, I would be very grateful because then I’ll know if I can wait for the next version of this plugin or whether I’ll have to find something else…

        (ps. and thanks for your help – again)

    • It will be released this week.

  8. Other widget logic plugins break your head or break your site. This one: neither!

    Simple, intuitive, excellent plugin.


    • Thanks Denis. FYI: new features are coming

  9. Really awesome plugin – so far it works perfectly :-)

    Keep up the good work!!


    • Thank you Nick :)

  10. I am trying to restrict certain widgets only to admin, but its not letting me to do it… It displays the widget even to Non Admins.. Please Help Me Out…

    • Rajbir, you definitely can achieve that. Just use rw_display_widget() filter, adjusting the method described in this post:

  11. having some problems with this widget.

    I’m running a multi site network, new users who create a site on the network are super admins, but when i activiate this plugin, the widget menu disspears all together.

    Why is that? I need users to be able to edit widgets

    • Gilad, Restrict Widgets is not multisite compatible yet. We’ll be working on it in one of the future releases.

      • I see. Too bad, it’s exactly what i’m looking for.

        Thank you

  12. Ok SImon.
    Update to the just released version 1.1.1

    Then add this to your functions.php and adjust according to your needs:

    function custom_rw_display_widget ($display, $instance) {
    if (is_category() && $instance['title'] == 'Your widget title') { // change Your widget title
    $display = true; // or false if you want to hide it
    return $display;
    add_filter('rw_display_widget', 'custom_rw_display_widget', 10, 2);

    And please post your support questions to our Support forum.

  13. Hi,

    I have now received and updated your widget plugin….thank you, however, I am still having the same issue when trying to only show my widget under all ‘category’ pages. If I add show widget under ‘store’ this seems to work but if I only want my widget showing under /category/* then the widget disappears?

    Can you please help with this issue?



  14. Hi,
    How soon will this bug fix be released as when trying to show my widget on only category pages it doesn’t work?

    • Good timing Simon – it was just uploaded to the repository.

  15. Thank you Attila. We’ll be releasing a bugfix for RW shortly.

  16. Reading Jenny’s comment, I had the same problem, but the fix I wrote in my previous comment will solve it.

  17. Hi, this is a fine plugin, but I had to fix a small bug in the display_frontend_widgets function. The problem was that, when using WPML the language checking was always processed, even there was no any selection in the options. This caused malfuctioning. Here is the quick fix, but you may find better way:

    if(function_exists(‘icl_get_languages’) || function_exists(‘pll_the_languages’))
    // check, if there is any language specific settings
    $needtocheck = 0;
    foreach($instance[‘rw_opt’] as $key=>$value)
    if(strstr($key, ‘language_’))
    $needtocheck = 1;

    … the rest of the code for this block


  18. Sounds like a bug – added to our To-do list.

  19. Hi there,

    This seems like an awesome plugin, but I’m having trouble getting it to work. Restricting user roles doesn’t interest me – I just want to be able to have certain widgets (menus mostly) appear (or not) on certain pages to avoid oodles of templates and sidebars. Seems to work if I choose the “hide” option, but not the “show” option. Although I can proceed using “hide” – will be much more tedious to maintain as there are more pages to hide for each condition.

    Looking forward to future updates.

  • 14 plugins, 1 320 808 downloads and more to come. Interested?

    Stay in touch

    Enter your email to receive updates when new posts or plugins are published. (No spam, we promise.)

    Join the Site

    Get instant access to our free support forum.

    Sign up