SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a sharepoint portal which have hundreds of subsites. The users can create new site and by default when a site is created it has Libraries, lists and discussions link out of the box. I got a request from users to remove all the Site Pages link (under libraries section).

Can this be accomplished using PowerShell script?

share|improve this question
up vote 2 down vote accepted
$site = Get-SPSite -Identity http://myportal
foreach ($web in $site.AllWebs) { 
   $list = $web.Lists["Site Pages"]
   $list.OnQuickLaunch = $FALSE 
share|improve this answer
Your answer even though it will work fine, is a re-active one which requires the powershell scriplet to be run everytime a site is created. See my answer below for a better solution. – Fox Mar 5 '12 at 8:11
I can agree because I've answered only concerning the already created sites and the ability to use the powershell. Of course it's not help to manage the sites will be created int the future. Yes, the site template is one of the easiest option to handle it without touching Visual Studio. – Alex Boev Mar 5 '12 at 8:51
Thanks for the script Alex. – Kannan Mar 5 '12 at 12:44

The short and long answer is : Use a site template of course. Create a site which you customise the way you want by removing the Site Pages link and complete all your other customisations for that site.

Backup the site as a template.

Configure your root web to allow that site template for new sites.

share|improve this answer
Thanks Fox. The script by alex helped me to temporarily fix this issue and as you said I have to change the site template and I think I have to remove the Site pages from NavBars section in Onet.XML file. – Kannan Mar 5 '12 at 12:46
Hi There. Instead of hand editing the onet.xml, why dont you just edit a site created with that template and resave the template? Sometimes we overcomplicate things for ourselves. The gold rule with Sharepoint is KISS (Keep it simple stupid) <-- Not saying your'e stupid, but you catch my drift? – Fox Mar 6 '12 at 5:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.