locked
Delete webpart using stsadm RRS feed

  • Question

  • Hi,

    How can I delete a web part without knowing it's name using stsadm?
    I ran enumallwebs -includewebparts command and got the web part dump, some of them have the status as "missing", it doesnt show the name but only its GUID.

    I need to delete them with their GUID rather than their name.

    Thanks,
    Cutloo

     

    • Moved by Mike Walsh FIN Wednesday, March 30, 2011 10:43 AM stsadm so clearly an Admin question not programming (From:SharePoint - Development and Programming (pre-SharePoint 2010))
    Wednesday, March 30, 2011 9:46 AM

Answers

  • Try checking out Gary Lapointe's custom commands.  Here's one that allows you to change the state of a web part, including deleting it, and one of its parameters is the web part ID.  http://blog.falchionconsulting.com/index.php/2007/10/set-web-part-state/

    Hope that helps - M


    - Michael Mukalian - 2010 MS MVP SharePoint Services - MCTS: MOSS 2007 Configuration - http://www.mukalian.com/blog
    • Marked as answer by Emir Liu Thursday, April 7, 2011 5:18 AM
    Saturday, April 2, 2011 5:17 PM
  • Hi Cutloo,

    you can get the names of webparts by quering by GUIDs but DON'T DO ANYD DIRECT QUERY ON CONTENT DATABASE this leads you to be out of support of microsoft. but you need to create an small custom application by using sharepoint object model this recommended way for querying sharepoint.

     

     

    for more details about how to get webpart name by GUID by using object model, follow

    http://stackoverflow.com/questions/2632953/get-the-guid-of-a-webpart-in-sharepoint-2007

    http://www.sharepointoverflow.com/questions/4459/how-to-get-current-web-part-guid


    Best Regrads, Ahmed Madany
    • Marked as answer by Emir Liu Thursday, April 7, 2011 5:19 AM
    Monday, April 4, 2011 9:53 AM

All replies

  • Hi Cutloo,

    Open the site as http://sitename/?contents=1, (make sure not to put default.aspx in site name) it will open web part maintainable page and you will get all web parts applied on the page.

    check the status and delete / close them as per your requirement.

    or 

    you can open the site in Designer and check missing web part from the zones and delete them

    hth


    Warm Regards, Pratik Vyas | SharePoint Consultant | http://sharepointpratik.blogspot.com/
    Wednesday, March 30, 2011 11:33 AM
  • I do not know the name of the web part to identify them from the name , I only know the GUIID.

    Neither the web part maintenance page nor the designer show the GUIID of the web parts.

    Thursday, March 31, 2011 1:03 AM
  • You could alwaysdo a select * from dbo.allwebs table. This would give you all the names with GUID's from the content db.
    Thursday, March 31, 2011 6:49 PM
  • Try checking out Gary Lapointe's custom commands.  Here's one that allows you to change the state of a web part, including deleting it, and one of its parameters is the web part ID.  http://blog.falchionconsulting.com/index.php/2007/10/set-web-part-state/

    Hope that helps - M


    - Michael Mukalian - 2010 MS MVP SharePoint Services - MCTS: MOSS 2007 Configuration - http://www.mukalian.com/blog
    • Marked as answer by Emir Liu Thursday, April 7, 2011 5:18 AM
    Saturday, April 2, 2011 5:17 PM
  • Hi Cutloo,

    you can get the names of webparts by quering by GUIDs but DON'T DO ANYD DIRECT QUERY ON CONTENT DATABASE this leads you to be out of support of microsoft. but you need to create an small custom application by using sharepoint object model this recommended way for querying sharepoint.

     

     

    for more details about how to get webpart name by GUID by using object model, follow

    http://stackoverflow.com/questions/2632953/get-the-guid-of-a-webpart-in-sharepoint-2007

    http://www.sharepointoverflow.com/questions/4459/how-to-get-current-web-part-guid


    Best Regrads, Ahmed Madany
    • Marked as answer by Emir Liu Thursday, April 7, 2011 5:19 AM
    Monday, April 4, 2011 9:53 AM