In this SharePoint tutorial, we will discuss how to hide list or document library in SharePoint. We will learn how to hide a SharePoint list or document library programmatically using the SharePoint server object model code. And also we will discuss how we can hide a list or document library from SharePoint Designer 2013/2010.
By using the server object model code, we can hide the list or document library in SharePoint 2010/2013/2016/2019. By using SharePoint designer approach we can hide the list or document library in SharePoint on-premises and SharePoint Online.
Hide List or Document Library in SharePoint Programmatically using Server Object Model Code:
We can easily hide the SharePoint list or document library using the SharePoint server object model code. Below is the code to hide list or document library. You can write in a visual web part or in a feature in SharePoint 2010/2013/2016.
using (SPSite site = new SPSite(“http://SiteURL”))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists[“MyList”];
list.Hidden = true;
list.Update();
}
}
Once you execute the code, MyList will not be visible in the Site Contents page in SharePoint.
Hide List or Document Library in SharePoint using SharePoint designer 2013/2010
We can also easily hide list or document library using SharePoint designer 2013/2010.
For this Open the SharePoint site using SharePoint designer 2013/2010, then from the Site Objects click on Lists and Libraries.
Then Click on the particular list which you want to hide, This will open the settings home page.
From the Settings page, from the General Settings, Check the check box “Hide from browser”.
Then Click on Save.
Now when open the SharePoint site in the browser, the list will be hidden.
You may like following SharePoint tutorials:
- The specified file or folder name is too long SharePoint 2013/2016 or SharePoint Online
- Add items to SharePoint list using PowerShell
- How to activate publishing feature in SharePoint 2013/2016 using PowerShell Script
- Create a Leave Request Approval Workflow using SharePoint Designer 2013
- SharePoint designer workflow examples Create a workflow using SharePoint designer 2013 video tutorial
- Export SharePoint 2013 List Items to Word Document using SharePoint Server Side Object Model
Hope this SharePoint tutorial explains, how we can hide a list or document library using SharePoint server object model code and using SharePoint designer 2013/2010.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com