Jul 30 2019 04:47 AM
I on Content Type Hub,
I can't delete some content types. These Content Types used in some List Templates I create.
I deleted all these template already, and every list, every content type relate to this Content Type. But this still not working?
Can anybody help?
Jul 30 2019 05:11 AM
Jul 30 2019 05:12 AM
Yes. I remove all of the things related to these content types. But it's not working.
Jul 30 2019 05:24 AM
Jul 30 2019 05:27 AM
Yes. And I attempt to find anything relate these content type. But I don't know what I'm missing.
Jul 30 2019 05:38 AM
SolutionJul 30 2019 05:51 AM
Yes, I have published these content types before.
But I unpublish and remove all the other content types easily, but only 4 content types I use in List templates that can't be deleted.
By the way, I have a question. When you upload the list template to another site, can this site receive the content Type go with the template automatically? (the content type haven't existed on the site before)
Jul 30 2019 05:59 AM
Jul 30 2019 07:06 AM
What mechanism are you using to make your List Templates available? Are you using a Sandboxed Solution for this? If so, you'll typically also include the Content Type definition in this solution.
I only use Saving list template in List Setting. And import and export these template via Web Designer Galleries -> List Template, that is the only way I know until now.
Sandbox Solution is the method using code, right? If you have an official blog or topic about this, please share with me.
@Paul Pascha wrote:
The Content Type is not part of your List Template so you have to make sure the Content Type is available on sites where you want to create lists based on your template.
You mean, if I don't have the content type already on my site, I can't Upload or Using these Templates?
Jul 30 2019 07:55 AM - edited Jul 30 2019 08:09 AM
I got it. Thank you. I can't see the second Stage of Recycle Bin as you said. Sr.
Thank you very much.
But relate to this topic, I wonder how we can find:
- Lists relating to a specific Content-Type, so we can easily find these Lists and remove them before we remove the Content-Type
- Content-Types relating to a specific Column, so we can easily find these Content-Type and remove them before we can remove the Column
Jul 30 2019 08:40 AM - edited Jul 30 2019 08:41 AM
I totally agree. There used to be ways to discover this using server-side API's but these are not available in SharePoint Online...
Aug 20 2021 04:22 AM
For M365 group sites, you will need to have scripting enabled at the tenant level. It might take up to 24 hours to take effect. If after doing so you still can't delete content types or template files within, you might need to turn on scripting on the specific site. Here's the MS article describing how to do so.
Here's the PowerShell scrip for quick reference:
Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 0
Or for PnP.PowerShell
Set-PnPSite <SiteURL> -NoScriptSite $false
Jul 30 2019 05:38 AM
Solution