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 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!