diff --git a/code_samples/data_migration/examples/delete_content.yaml b/code_samples/data_migration/examples/delete_content.yaml new file mode 100644 index 0000000000..64694c48ce --- /dev/null +++ b/code_samples/data_migration/examples/delete_content.yaml @@ -0,0 +1,8 @@ +- + type: content + mode: delete + match: + field: content_remote_id + value: __REMOTE_ID__ + only_visible_content: true # Optional, default: true. If set to true, only visible content will be deleted. + allow_no_delete: false # Optional, default: false. If set to true, the migration will not fail if no content is found using the specified criteria. diff --git a/docs/content_management/data_migration/importing_data.md b/docs/content_management/data_migration/importing_data.md index 21abb9ab84..5eadd34005 100644 --- a/docs/content_management/data_migration/importing_data.md +++ b/docs/content_management/data_migration/importing_data.md @@ -242,6 +242,12 @@ In this case you assign the `parent_folder_location_id` reference name to the lo [[= include_file('code_samples/data_migration/examples/create_parent_and_child_content.yaml') =]] ``` +Use the `delete` mode to delete content items: + +``` yaml +[[= include_file('code_samples/data_migration/examples/delete_content.yaml') =]] +``` + ### Images The following example shows how to migrate an `example-image.png` located in `public/var/site/storage/images/3/8/3/0/383-1-eng-GB` without manually placing it in the appropriate path.