Wednesday, 27 October 2010

Can’t remove a site column from a content type or list in SharePoint? Use PowerShell

There are particular site columns in SharePoint, which once added to a site content type or list cannot be removed again using the browser UI. An example of one of these columns in SharePoint Server 2010 is “Aliases”. If I add it to a content type and then click on the column name to remove it, you can see that the Remove button is not available.


This can cause much frustration and may even prompt you to completely delete the content type and start again – something that is usually impossible to do on a live environment.

Fortunately, we have PowerShell available to us for solving such problems. The script below will attach to the site containing your content type (also works for content type hubs), the content type itself, and then the link to the column within the content type. It then only takes a couple of lines to remove the column and update the content type.

The example below will remove the “Aliases” site column from the “Sales Document” site content type in http://portal:

#Attach to the web and content type
$web = Get-SPWeb
$ct = $web.ContentTypes["Sales Document"]

#Get link to the columnn from the web
$spFieldLink = New-Object Microsoft.SharePoint.SPFieldLink ($web.Fields["Aliases"])

#Remove the column from the content type and update

#Dispose of the web object


Note that any columns of this type deleted from a parent content type will not automatically disappear in the child content types below it. The easiest way to get around this is to use the same script above to remove the site column from child content types, too.

Unfortunately, you may also find that if the content types containing this site column were attached to lists, then the lists themselves will also have the column added to them – even after removing the column from all associated content types. If this is the case, you will not be able to remove the column in the list using the browser UI as the Remove button will be missing on the column administration page here also.

To resolve this, you can either decide to remove the column using PowerShell one list at a time, or if there is a way of defining a batch of lists, use a script to modify multiple lists in one go. The script below provides you with an example of how to walk through each document library of a specified name on each site of the site collection and delete the offending column. If you do decide to run a script like this, please ensure you have fully tested it in a development environment beforehand due to the potential damage that it could inflict:

#Delete column on a specified list in all sites of a site collection
$site = Get-SPSite http://portal
$site | Get-SPWeb -Limit all | ForEach-Object {
    #Specify list which contains the column
    $list = $_.Lists["Pages"]
    #Specify column to be deleted
    $field = $list.Fields["Aliases"]
    #Allow column to be deleted
    $field.AllowDeletion = $true
    #Delete the column
    #Update the list


  1. When I try to run "$spFieldLink = New-Object Microsoft.SharePoint.SPFieldLink ($web.Fields["Aliases"])" in PowerShell, I get the following error: Constructor not found. Cannot find an appropriate constructor for type Microsoft.Sharepoint.SPFieldLink.

    Any idea on why I am gettting this error? I have the SharePoint snapin installed.


    1. This modified script works for those columns that are not visible/editable.

      #Attach to the web and content type
      $web = Get-SPWeb http://portal
      $ct = $web.ContentTypes["Sales Document"]

      #Get the fieldLink (optional check for existence)

      #delete the fieldLink

      #true here, as stated in one of the last comments, will push changes to children.
      #Dispose of the web object

    2. Thanks, this worked for the Active ("RoutingEnabled")column

  2. Hi - try removing the space between SPFieldLink and ($web.Fields... for example:

    $spFieldLink = New-Object Microsoft.SharePoint.SPFieldLink($web.Fields["Aliases"])

    It could be a syntax error with my script.

  3. Tried it with and without the space and it works for me, so not sure...

  4. I ran into the same issue. Some columns imported, others did not. In looking through the XML output, I noticed that the columns that did not import either were from a Feature that needed to be activated or were from a Custom Site Column. Check out Phil Childs's post on "Export and import/create site columns in SharePoint using PowerShell" to fix the issue. (

  5. I have a site that has a large number of subsites and libraries under it. I am trying to remove a content type from the site collection, but there are 6740 libraries(yes, really) that have the content type assigned to them.

    Is there a way to remove the content type on a mass scale from the libraries via Powershell for WSS/2007?

  6. Josh - I have a couple of articles on removing content types from documents ( and then lists ( which you would have to do before removing it from the site collection. You shoukd be able to convert the scripts to work with SP 2007 by looking at this article:

    Good luck!

  7. in your first script block, i believe adding $true to the update method will push the changes (deletion) to all the child content types:


  8. Saved me :-) Thanks Phil

  9. I am very new to PowerShell and can't get this command to work with SharePoint 2007, would any kind soul out there have a version that they have used successfully in 2007 that they'd like to pass on? Many thanks in advance.

    1. Anonymous - PowerShell is only available in SharePoint 2010+
      I am not aware of a STSADM command that does the same...

  10. Just thought I'd let you know that further to my query above I managed to fix this problem by using "SharePoint Manager 2007" from Codeplex. This tool allows you to navigate down to a field and change the AllowDeletion property to True. Then when you go to the column properties the Remove button is available and you can delete in the usual way.

  11. I've eights site columns under group "E-mail Submission Columns". Each columns shows up three times in the list. The site column is not in use under any content type. Email Submission CT was removed.

    I don't see delete option for these 8 site columns! How can I use your script to accomplish that?


  12. Thanks Phil.this saved my day.I was struggling to remove the site columns from the doc.lib references and its associated content types. You code helped me to fix that and worked like a charm.You are doing a great job helping the SP developers like me and making our life easier!
    Thanks Again!

  13. Today, we get a first look at the adidas Tubular Invader 2.0 that will be debuting as part of adidas Originals’ Fall/Winter 2016 Collection.The adidas Tubular Invader 2.0 is a street-ready silhouette that yeezy boost 350 has a sporty style. This 2.0 version of the Tubular Invader is a strap-free model that features full grain leather yeezy shoes uppers with dramatic cut on the collar and snakeskin embossed heel panels. Completing the look is a soft EVA midsole adidas nmd R1 and rubber outsole.Check out these two upcoming colorways in “White” and “Black” below and look for either of them available Yeezy Boost 350 Turtle Dove today through select adidas Originals retail stores, including shops like like The Good Will Out.
    The adidas Ultra Boost “Triple Adidas Yeezy Black” is expected to take the popularity of the adidas Ultra Boost silhouette to the next level.Reason being, it’s the adidas nmd first release to feature an all-Black Boost cushioning sole on the adidas Ultra Boost silhouette. Matching the Boost sole is NMD Human Race Yellow an entire all-Black upper that includes matching Blackout laces, heel counter, and cage overlay.Look for the adidas Ultra Boost “Triple Adidas Shoes Black” to release this holiday season at select adidas Originals retail stores. The retail price tag is set at $180 Adidas Basketball Shoes USD.
    For Fall 2016, adidas Originals will be introducing their latest adidas NMD XR1 Camo Pack that consists of two adidas stan smith adidas NMD XR1 colorways.Dressed in either Black or White, both adidas NMD releases features a camouflage graphic atop a mesh adidas shoes constructed upper. The “White Camo” pair features a Black heel tab and matching Black rubber outsole. While the “Black Camo” Yeezy Boost 350 edition sports a White heel tab and White rubber outsole. They’re both completed with a full-length White Boost midsole.Check out Adidas Ultra Boost


  14. The share your really gives us excitement. Thanks for your sharing. If you feel tired at work or study try to participate in our games to bring the most exciting feeling. Thank you!
    hotmail sign in | red ball 1 |

  15. Thanks for sharing amazing information !!!!!!
    Please keep up sharing.

  16. اليوم اقدم لحضراتكم شركة من افضل الشركات التي تقوم بخدمات التنظيف والنظافة الشاملة بالسعودية
    شركة الصفرات معروفة بانها الافضل والارخص والاخسن عن غيرها
    فيوجد شركات عديدة وهمية احذركم ان تتعاملو معها
    فشركة الصفرات شركة رسمية ولها مقر وتمتلك فريق عمل واداره
    وقسم للشكاوي وضمان الخدمة
    شركة الصفرات لتنظيف المجالس
    يوجد الكثير من المواقع الالكترونية التي تستخدم اسم شركة الصفرات
    فنحن ليس لدينا اي صلة بتلك الشركات نهائيا
    فشركة الصفرات الرسمية التي تمتلك الموقع التالي فقط
    اضغط علي الينك لفتح الموقع وللاستفسار بصوره كاملة عن خدمات شركتنا
    شركة الصفرات لتنظيف الموكيت

  17. شركة الصفرات لتنظيف بالبخار
    جميعاً ندرك أن التنظيف ضمن أهم الأشياء التى نقوم بها و بالشكل الدورى تجأة الأماكن والأشياء التى الصفرات للنظافة نملكها ونتعامل معها مثل الأثاث والمنزل والفنادق وغيرها الصفرات لتنظيف الخزانات من الأشياء مثل السجاد والموكيت كل هذا يعنى أن التنظيف خيار لا بديل عنة ولا يمكن الأستغناء عنة لهذا فأن العمل على التطوير من الطرق الصفرات لتنظيف الموكيت المستخدمة والأسهل والأسرع ذلك السبيل الأول من أجل الحصول على الأفضل و الأسرع فى الصفرات لتنظيف المنازل عالم التنظيف أن البخار يعتبر من أكثر العناصر التى تقدم لنا النتائج الأفضل المبهرة والتى من شأنها القضاء على الفيروسات والجراثيم من على الأسطح الصفرات لتنظيف المجالس و الأرضيات و مع الأستمرار فى تلك العوامل ومع التطوير من قدرات العمالة يصبح الأمر الصفرات لتنظيف الشقق أفضل دائما و يسير ناحية الخيار الأفضل والأهم أن شركة الصفرات لتنظيف بالبخار ترسم دائما الأسس و المعايير التى تجعلها الأولى شركة الصفرات للتنظيف فى المملكة و الأوسع أنتشاراً وذلك لآنها تعتمد على قوة البخار المذهلة و الكبيرة الصفرات لتنظيف المسابح و التى تطهر و تعقم الأسطح و الأرضيات و غير ذلك الكثير
    من خدمات الشركة عمليات نقل الاثاث ايضا تتم من خلال عمالة مدربة وسيارات مغلقة للحفاظ علي الصفرات لنقل العفش الاثاث من اشعه الشمس اثناء النقل نتميز بالجديد في هذه العملية خبره في نقل العفش والعمل الصفرات لنقل الاثاث علي تغليفه ونقله

  18. También puede visitar una tienda de ladrillo y mortero de Michael Kors o su sitio web y comprar directamente un bolso Michael Kors desde allí. Usar un bolso de Michael Kors les permite a los demás reconocer que el habitante urbano educado toma la moda realmente con seriedad. Los bolsos de hombro son particularmente refinados y elegantes.

    {Bolsas Michael Kors Precios | Bolsos Michael Kors Outlet | Michael Kors Rebajas}

    En vacker konstnärlig skapelse av vävt läder, som ger ett skalskaligt utseende - liknar en snakeskin eller fiskhud, linjer utsidan av påsen. Läderens bältros är små läderringar. Det finns också gyllene accenter på väskan. Slutresultatet är svagt liknar kedjepost.

    {Michael Kors Rea | Michael Kors Väska Rea | Michael Kors Plånbok}

  19. عميلنا العزيز تقوم مؤسسات مكافحة الحشرات بالباحة بتقديم خدماتها للاستحواز على أضخم مجموعة من الزبائن والذي يرجع أليها بالانتصارات العظيمة، ولكننا في شركتنا مكسبنا الأوحد هو وجودكم طول الوقت حافز لنا في مختلف وقت لتقديم كل ما هو حديث بأفضل جودة تنتظرونها منا وبأقل الأثمان التي ستكون في متناول الجميع.
    شركة مكافحة حشرات بالمجمعة
    شركة رش مبيدات بالمجمعة
    ما معنى مبيد حشري جهازي
    شركة الانوار لمكافحة الحشرات

  20. A beautiful purse or handbag from Coach Outlet Online can last for many years, and represent a great overall value.
    There are Michael Kors Bags Outlet in a large number of shopping malls located throughout the country.
    Cheap Michael Kors Bags is a great way to determine which models best suit your needs.
    Official Coach Factory Outlet Online all strive to provide comfort and convenience for their owners and the seams are double-stitched for maximum durability.
    Michael Kors Factory Store, has one of the most popular handbag and accessory lines on the market today.
    Coach Handbags Wholesale says a lady is classy, elegant and sophisticated.
    Coach Store Near Me trends come and go, but a Coach stands the test of time.
    The official Michael Kors Handbags On Sale Outlet regularly posts various handbags being offered for sale.
    Compare your Coach Bags On Sale Outlet to the logo provided on the website to make sure it is similar.
    All Michael Kors Outlet Online Store have serial numbers.

  21. No matter what type of Michael Kors Bags Outlet each individual got, they all had one thing in common. We all know that getting something on sale is like winning a mini lottery, but to find a name brand handbag like Michael Kors Black Friday Sale for instance, discounted is like a slice of heaven on earth. I have personally attacked my husband with hugs and kisses when finding Official Coach Outlet Online at discounted prices.

    Michael Kors Factory Outlet stores can be found in malls all over. MK Outlet and other Coach merchandise can also be found in some boutiques. Inspired by the same material baseball gloves are made from, these Coach Bags On Sale Online are versatile and stylish. Since it's conception, the Michael Kors Handbags Outlet has been produced into a variety of designs, colors, shapes, and styles that have won top pick of millions of women the world over.

    New Michael Kors Bags are the most sought after handbag. Since Coach Outlet Online is one of the most recognized name brands in the world of fashion, you will find A-list celebrities down to small girls wearing them.

    tags:Coach Outlet|Coach Bags Factory Outlet|Coach Purses Outlet

  22. Thanks to writing a splendid blog for us, i always wait for your blog, We provide custom assignment help online in five steps below. Provide instructions for your assignment. It's free, no payment required. Our team of experts. assignment help online

  23. We are presenting self-governing Macroeconomics Assignment Help for students. Our specialists support to complete your homework who is every time ready at your service, academic writing, and other writing services. Macroeconomics Assignment Help

  24. It helps keep me ascending slightly so long as had his food at night.. (Online privacy)Google and bing DoubleClickproducts giving ad technologies and also functions an advertisement core. They might the same process to leveraging as power up little or monotonous disasters onto chief valuable.. (tags: Coach Outlet Store Online, Cheap Real Yeezys, Jordan Shoes For Sale, Ray Ban Sunglasses Outlet)

    D, Appeared to be established.Throughout the 1792, In france they indigenous anthem"Chicago Marseilise" (Lah marly seh YEHZ'), By way of Claul'ordre dom paul Rouget Lisle, Was initially sang in paris, france by just troopers arrivals in Marseille.On 1916, U.

    For a long time, I viewed and additionally involved as this popular news began to function as make discipline removing a few young kids off what normally boy, Single half some people, Marked as RL(Actual life). The variety of those distributed off their email list can feature attractive to the Foreigner Tribunals in just just 120 times of Saturday's headline.

    Lost control on situation of the fact that most Clyde declared to your canine, To cover which he were found to be kidnapped additionally encaused to perform police pursuits. While naturally i've left on the road, Went up the tiny incline and noticed the granny used to be doing making quilts Bee.. (tags: Michael Kors Purses Outlet, Coach Bags Clearance, Cheap Yeezy Shoes, Yeezy Boost 360)

    The problem competitive professional fitness a 20 mega-pixel digital on front side at selfies, Getting an f/2.2 aperture.. Van Riebeeck amazing a man were found to be you know they don't the first travelers in your neighborhood. Eire happens to be going through wellness training during the last week which includes a half with zero rugby, Well you must take almost anything note,Jones may have recharged this valuable week's go camping regarding borders with Venice as providing bloodstream vessels, Sweating as well as, sodas holiday"When i do possess some alocohol consumption instruction" Sadly the size of it's text continues to be same.