Try our conversational search powered by Generative AI!

Delete content types not available in code

ZZ
ZZ
Vote:
 

Hi,

We have got both blocks and pages that are no more available in code. How can we delete content types not available in code anymore 

We tried to delete one block through CMS admin site, but that block have got a lot of instances. So we have to delete them first and before that remove block from other pages/blocks. Is there any easier way to this ?

#318485
Mar 05, 2024 10:14
Vote:
 

You can use something like this to create a scheduled job or admin tool to delete missing content types on-demand.

https://world.optimizely.com/blogs/sanjay-katiyar/dates/2022/10/delete-unused-properties-and-content-types-in-cms-12/

#318496
Edited, Mar 05, 2024 15:51
Vote:
 

I believe Per Nergard and Jeremy Brown have helped develop a plugin for such as case, one is CMS 11 the other is an updated version for CMS 12.

https://gist.github.com/PNergard/8a1037dcea6918dfc558676bded4e7b9

https://gist.github.com/j3rbr0wn/29a197364b60c57d619b8070016566d2

#318607
Mar 07, 2024 11:16
Vote:
 

I had a quick look at the Jeremy Brown solution.  It would be easy to put that in a Razor Class Library and package it up for the Optimizely nuget feed.  I've even suggested it to the author :)

#319135
Mar 18, 2024 14:49
Vote:
 

Based on the gists from Jeremy and Per Nergard, with the suggestion from Mark I have create a plugin:

https://nuget.optimizely.com/package/?id=ContentCleaner

Should do the trick and all feedback is welcome.

#320057
Apr 05, 2024 11:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.