Tags: Collections, Delete, Products
Either triggered manually, or configured to run daily, this task will look for the oldest products in the collection of your choice, and delete as many of them as you wish.
- View in the task library: tasks.mechanic.dev/delete-the-oldest-x-products-from-a-specific-collection
- Task JSON, for direct import: task.json
- Preview task code: script.liquid
{
"collection_id__number_required": null,
"number_of_products_to_delete_at_once__number_required": null,
"test_mode__boolean": null,
"run_daily__boolean": null
}
Learn about task options in Mechanic
mechanic/user/trigger
{% if options.run_daily__boolean %}
mechanic/scheduler/daily
{% endif %}
Learn about event subscriptions in Mechanic
Either triggered manually, or configured to run daily, this task will look for the oldest products in the collection of your choice, and delete as many of them as you wish.
This task requires a collection ID - learn how to find yours.
Find this task in the library at tasks.mechanic.dev, and use the "Try this task" button. Or, import this task's JSON export – see Importing and exporting tasks to learn how imports work.
Found a bug? Got an improvement to add? Start here: ../../CONTRIBUTING.md.
Submit your task requests for consideration by the Mechanic community, and they may be chosen for development and inclusion in the task library!