Per Nergård (MVP)
OMVPSaaS CMS Developer CertificationCommerce Connect 13 Developer Certification +2
Jan 30, 2026
visibility 1495
star star star star star
(0 votes)

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:

  1. Get the contenttype ids you want to remove all content for and deleting the actual content type as well.
  2. Take a database backup
  3. Add the contenttype ids into a comma separated list
  4. 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.

Jan 30, 2026

Comments

error Please login to comment.
Latest blogs
Introducing Optimizely Feature Flagging: Flag Your Content Model

Feature flag Optimizely CMS content properties without code changes: visibility, validation, editors and whole content types, with any flag provider.

Andy Blyth | Nov 3, 2026 |

Introducing Optimizely Content Seeder: Seed Your CMS from Code

Seed Optimizely CMS 12 and 13 with pages, blocks, media and Visual Builder sections from a fluent C# definition, with optional AI-written content.

Andy Blyth | Nov 3, 2026 |

Optimizely DXP Alert: Are You Affected by the October 2026 Node.js Security Vulnerabilities?

On October 27, 2026, Optimizely published a security advisory regarding recently disclosed Node.js vulnerabilities affecting Node.js 22.x, 24.x, an...

Madhu | Nov 2, 2026 |

Build Your First Opal Tool in C#

Optimizely ships a C# SDK for building custom

Adnan Zameer | Nov 2, 2026 |