Some System Columns Cannot Be Deleted

Introduction

Recently, I have faced an issue regarding removing the ‘system column’ from the site content type. The warning says 'Some system columns cannot be deleted' as shown in below screen capture. I have created custom content type and added ‘Description’ which is there by default, and when removing it from the GUI I am unable to remove. The only way to remove the system column from the content type is via PowerShell. For this scenario, I have used PnP Powershell module.

Removing Site Column from SharePoint site content type

Steps

Step 1

Connect to the site using SharePoint PnP PowerShell.

Connect-PnPOnline -Url https://contoso.sharepoint.com/teams/qaVinay -UseWebLogin

Step 2

Validate the connection

Get-PnPConnection

Step 3

Run the below powershell command to remove the site column from the content type. While trying to remove from GUI, you would see message saying that ‘the column cannot be removed’.

Removing Site Column from SharePoint site content type

Remove-PnPFieldFromContentType -Field '<INTERNALFIELDNAME>' -ContentType '<NAMEOFCONTENTYPE>’

In this case, the below command did work for me

Remove-PnPFieldFromContentType -Field ‘RoutingRuleDescription’ -ContentType ‘RecordRetention’

Step 4

After that validate the column in the content type and now you should see the system column is removed from content type.

Note: Please note that the above remove field only removes the column from the content type and the data associated with system column is lost and there is high chance that the data associated with system column is not recoverable.

Conclusion

Thus, in this article, we have seen how to remove the system column from the content type using PnP Powershell module.

References

Recommended Ebook

SharePoint Framework (SPFx) A Developers Guide

Download Now!
Similar Articles