Hello @ampeli,
It’s not possible with use of Custom Sidebars to hide widgets/sidebars on pages that are password protected because that protection only covers content of the page, not whole template.
It will require custom change in your template, please see here https://wordpress.stackexchange.com/a/137613
kind regards,
Kasia
Hello,
how do I have to include the linked php-code into my homepage? I use the custom sidebars plugin and want my sidebards to be visibly only if a user is authenticated.
To me it is not clear where and how the code needs to be modified, preferably such that updating the custom sidebars plugin to newer versions does not overwrite these changes.
Thanks a lot & Greetings
Matzzzl
Hey @matzzzl,
Hope you’re well.
As far as I understand you want to show widget for logged in users. You don’t need to add PHP codes for that. You can do that from visibility options of the widget. First, click “Visibility” button from widget;

Then click plus icon and “Guests” filter from menu;

After that, you can choose logged in option.
If this does not solve the problem, can you create a new thread? According to WordPress.org forum guides you should open a new topic even if the issue looks same;
Unless users have the exact same version of WordPress on the same physical server hosted by the same hosts with the same plugins, theme, and configurations, then the odds are the solution for one user will not be the same for another. For this reason, we recommend people start their own topics.
(https://make.wordpress.org/support/handbook/forum-welcome/#post-in-the-best-place)
And we will gladly investigate this further for you.
Cheers,
Oguz
Hi Oguz,
thanks a lot for the great explanation.
Unfortunately my aim was to achieve a different kind of password protection: if you navigate to
Pages -> All Pages
and put the mouse over one of your pages, there is the option “QuickEdit”, where you can set up a simple password protection for this page.
Greetings & Thanks
Marcel
P.S.: I did not open a new thread because I think separating this discussion into two threads is not helpful.
Hello @matzzzl
Out of the box, I am afraid it is not possible to password protect a widget. One solution is that Oguz suggested above with Visibility option, otherwise this will require custom coding. Please check this solution:
https://digwp.com/2009/08/password-protect-more-than-the_content/
In the meantime, I will suggest this as a feature request to our developers. Hopefully, if it will be requested by more users, our developers will consider adding it to the Features List.
Per WordPress regulation, please open a new topic if you have any further questions. This way, the author will not be getting email notifications each time when there is a new post in the thread.
Have a nice day and take care!
Kind regards,
Nastia