EndUserSharePoint.com: Closing web parts vs REALLY closing web parts
Anyone up for a SharePoint contest? Go to your entrance page and find out how many closed web parts you currently have. No cheating. Go ahead… I’ll wait.
In this contest, everyone is a winner because I bet you are going to be pretty surprised when you check things out.
It happened again today. I was looking at a client’s site, working on implementing a search mechanism through a search web part.
Whenever I’m working on a page for the first time, I always check to see if there are any closed web parts on the page. Usually when someone first starts working with SharePoint, they assume the ‘x’ in the web part means to close/delete the web part from the page. In the case of SharePoint, the ‘x’ really means “Hide this web part, but still pull in the data”… one of the typical “gotchas” when starting out.
Sure enough, there were 26 closed web parts on the page. No wonder is was taking a while to load. This happens more often than you might think. I’ll go in and clean up the page and make sure the site manager understands how to properly remove web parts from a page.
What was your score? Leave a comment and we’ll see who gets the prize for the week. I’m betting 26 isn’t even close to a winner.
How do you see your closed web parts?
- Site actions -> Edit page
- Click “Add a web part” over any web zone
- On the screen that pops up, bottom right corner, click the link “Advanced Web Part gallery and options
- Look in the right hand panel to find the number of closed web parts
The real question is now that you’ve found them closed, what can you do about it.
- Click the “Closed Web Parts” link in the tool panel
- Wait….
- Drag each one of the closed web parts on to the page and delete it: edit -> Delete
Happy hunting and deleting.
Mark















I only have 8 closed webparts on my main site. I agree that it is annoying that Microsoft uses the X to close everything else normally but the X in SharePoint means it hides the webpart on the page but leaves a connection to the webpart.
Only 4 :(
Woo hoo! I got a zero!
I got a 6
LOL! Had a similar post a while back: Read the article
At the time, the client had 54 web parts in the Page Gallery!
-Rich
Note: Rich, I updated your post because the URL was running off the page. Nice article. Everyone should read it.
Mark,
Thanks again for this tip! It’s really a good idea to do this occassionally if you have several people responsible for maintaining the content of a departmental/team site — as this is probably the biggest unintentional performance killer in SharePoint.
Chris
If you want to know what’s really happening behind the scenes, check out … http://www.thorprojects.com/blog/archive/2008/04/16/web-part-event-firings-and-why-you-shouldn’t-have-code-in-the-constructor.aspx
If you add “?contents=1″ at the end of the url you will access to the maintenance page where you can delete or restore all of the web parts in page.
For example:
http://myserver/default.aspx?contents=1
Alex – Thanks for that one. I had forgotten about it.
Rich – It looks like you scared everyone else away. That’s a LOT of web parts.
Rob – Nice article. Good to know what’s happening under the covers.
I only had 4. :(
32!!! Not too bad.
Matt – Glad to be of help. Hope your page is loading faster…
Mark
139 ;( My manager doesnt understand it, eventhough I’ve told her a mill times ;)
There is an easier way to delete them: use the maintenance page: append the string ?contents=1 to the end of your page url, so that
http://foobar/default.aspx
becomes http://foobar/default.aspx?contents=1
it will then give you the opportunity to check all the ones you want to kill and hit a single delete button. That way you 26+ folks will be at little more at ease.