How to hide “Lists and Libraries” from the web part gallery

I’ve been saying I’m going to start a blog forever now, so this seems like as good a time as any.  I’m so tickled that I found this solution that I’ve spent hours hunting for, that I feel like I must tell the world.

So I was trying to figure out how to hide the “Lists and Libraries” section from the web part gallery in SharePoint 2010 when a user tries to add a web part to their page.  By default when a user clicks “Add a Web Part”, this is placed at the top of the list with the focus, and all lists and libraries are visible:

I had spent several hours researching and tried several different solutions to no avail.  I had tried tinkering with JavaScript and JQuery but couldn’t get it to work.  I was able to hide the “List and Libraries” link with CSS, however the actual list of lists/libraries still displayed on the right.  One thing that does kind of work, is to set each list and library to “hidden” as explained in this forum.  The problem with this solution is that it also hides all the lists/libraries from the All Site Content page, even for admins.

I finally found the solution this morning, thanks to this post.  Basically you just open up the Master Page that your site is using, and add “ShowListsAndLibraries=false” to the WebPartAdder control.  So your markup would look like this:

<WebPartPages:WebPartAdder ID=”WebPartAdder” ShowListsAndLibraries=”false” runat=”server” />

Works like a charm!  Thanks so much to diffident and Aaron Han for figuring this one out!


(Visited 213 time, 1 visit today)

About Me

Wendy Neal

Wendy Neal

I am a .NET SharePoint Developer for DMI. I've worked with SharePoint since 2007. I love to share my passion for SharePoint and Office 365 by speaking at various industry and user group events, as well as writing articles for various publications and this blog.   Read More

MCSA Office 365
Top 50 SharePoint Blogs

Buy My Book


  • 2018 (1)
  • 2017 (1)
  • 2016 (8)
  • 2015 (23)
  • 2014 (20)
  • 2013 (22)
  • 2012 (15)
  • 2011 (13)