A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
Hi,
You could try to use this code snippet:
var contentType = ServiceLocator.Current.GetInstance<IContentTypeRepository>().List().FirstOrDefault(ct=>ct.ModelType == typeof(JumbotronBlock));
var contentList = ServiceLocator.Current.GetInstance<ContentStore>().ListContentOfContentType(contentType, false).ToList();
var contentRepository = ServiceLocator.Current.GetInstance<IContentRepository>();
var contentCount = contentList.Count;
for (int i = 0; i < contentCount; i++)
{
var contentUsage = contentList[i];
contentRepository.Delete(contentUsage.ContentLink, false, AccessLevel.NoAccess);
}