Scheduled job for deleting content types and all related content
In my previous blog post which was about getting an overview of your sites content https://world.optimizely.com/blogs/Per-Nergard/Dates/2026/1/scheduledjob-for-getting-overview-of-site-content-usage/.
I actually found a couple of content types that was related to decomission functionality that actually hade quite a lot of created content. So what to do? ContentTypeObliteratorScheduledJob to the rescue.
It's very simple:
- Get the contenttype ids you want to remove all content for and deleting the actual content type as well.
- Take a database backup
- Add the contenttype ids into a comma separated list
- Run the job and enjoy less code and a less bloated content tree.
I have only done a test run on one content type but for that it worked.
Link to my Gist: ContentTypeObliteratorScheduledJob.
Comments