I am currently working with Headless content types in Xperience by Kentico, and I have a requirement where I need to automatically unpublish content items once their configured End Date has passed.
To achieve this, I am planning to create a scheduled task that checks all relevant headless content items, compares their End Date with the current date, and unpublishes the content if it is already past the End Date.
Could you please confirm:
- Is this approach recommended for headless content types?
- Is there any built-in API or best practice for programmatically unpublishing headless content items?
- Is there any sample implementation or documentation that can help with this scenario?
Environment
Xperience by Kentico version: [30.9.1]
.NET version: [8]