Forum Discussion

ca_rem's avatar
ca_rem
Brass Contributor
Jul 30, 2019
Solved

Can't delete content types?

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?

  • I ran into this error quite a lot and every time I forgot to empty my Recycle Bin, especially forgot to look at the "Deleted from end user Recycle Bin" view which is only available to you if you are a Site Collection Administrator...

    You said you're on you Content Type Hub. Have you published the Content Types in question? If so, you could try to Unpublish them first (in my experience this shouldn't really matter though and I just tried on the site I've helped you with earlier...)

11 Replies

  • SpoTech's avatar
    SpoTech
    Copper Contributor

    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 https://docs.microsoft.com/en-us/sharepoint/allow-or-prevent-custom-script?redirectSourcePath=%252fen-us%252farticle%252fTurn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f#to-allow-custom-script-on-other-sharepoint-sites 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

     

  • paulpascha's avatar
    paulpascha
    Bronze Contributor
    Have you also removed everything from your site's recycle bin (both stages)?
    • ca_rem's avatar
      ca_rem
      Brass Contributor

      paulpascha 

      Yes. I remove all of the things related to these content types. But it's not working.

      • paulpascha's avatar
        paulpascha
        Bronze Contributor
        Do you get an error message stating the content type is still in use?

Resources