1

I'm in need of your expert help.

I made the dreaded error of deleting a few content types from the CT Hub without first unpublishing them from the subscriber sites and now they are orphaned forever and cannot be deleted, but it doesn't end there, it also means that every new site collection that is created inherits those orphaned CTS. The only solution I researched about it to re-create those deleted CTs using CSOM or Powershell in the CT Hub with the same ID of the deleted ones > then publish > then unpublish them and then delete them as mentioned here: Contenttype hub publishing old (deleted) content types

Only thing is I don't know the powershell or CSOM commands to re-create a CT with the same ID as the deleted ones. Please help.

Thanks in Advance.

1 Answer 1

1

You are correct on the aproach, recreating the content type with the same ID will allow you to publish and unpublish it, thereby removing it from subscribing sites.

Find your content type ID

The easiest way to find your content type ID is to look at the query string on the content type settings page:

enter image description here

Creating the content type

Next step is to create the content type. The easiest way to do this is via PnP PowerShell

Add-PnPContentType -Name "Project Document" -Description "Use for Contoso projects" -Group "Contoso Content Types" -ContentTypeId "0x0120D52000DADB39858EC2124684887BE3CF63B5AB"

https://github.com/SharePoint/PnP-PowerShell/blob/master/Documentation/AddPnPContentType.md

Content type IDs are pretty interesting, and you'll find it useful to understand how they're constructed. Check this out.

After creating the content type, you'll need to publish and then unpublish it. This can be done manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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