Hide The Default SharePoint Content Libraries/Lists *HACK*

Recently for a client I created a custom Document Library that is specific to their organization. After creating it I wanted to hide the standard document library that comes with SharePoint. I don't want to delete it, just hide it so it can't be accidentally created. Here in lies my problem. I search high and low for a possible solution. While waiting to here back from the SharePoint blog team, I decided try and find a workaround. This is what I came up with. 

I decided to look at the actually aspx page that you see when you select "Create" from the site content area. I thought maybe I can hide the fields as they are created on this page.  The file is called "/_layouts/create.aspx" and can be found at "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS". If you go down to line 158 you can see the code setting a string variable to the list template name. I found gold. After this line is where I inserted my nasty little hack.

if ((strTemplateDisplayName == "Document Library") || (strTemplateDisplayName == "Translation Management Library"))

This will hide the libraries from the view of the user. Just be aware that this might break if there is a Service Pack and/or Patch applied for SharePoint.

If you can shed some light on a better way please, let me know.


  • Did you ever find a more "standard" solution?

  • Wow, awesome blog layout! How long have you been blogging for?
    you make blogging look easy. The overall look of your site is magnificent, let alone the content!

  • Heya i'm for the first time here. I came across this board and I find It truly useful & it helped me out a lot. I hope to give something back and help others like you aided me.

  • I was wondering if you ever thought of changing the layout of your
    site? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1 or two pictures.
    Maybe you could space it out better?

Comments have been disabled for this content.