docs/extend/saved-objects/delete.md
This page describes how to remove a Saved Object type (unregister the type definition from your plugin). It does not cover deleting Saved Object instances via the client.
When you remove a Saved Object type from your plugin, you must ensure its name cannot be reused later.
Once a type has been registered and used in production, its name is reserved. Reusing that name for a different type would:
{{kib}} keeps a list of removed type names in packages/kbn-check-saved-objects-cli/removed_types.json so those names are never reused.
Remove the type registration from your plugin, delete the type definition file, and remove any references to the type.
Run the check that detects removed types and updates removed_types.json:
# Get your current commit ID
git log -n 1
# Get the merge-base commit with main
git merge-base -a <currentCommitSha> main
# Run the check with the baseline
node scripts/check_saved_objects --baseline <mergeBase> --fix
Replace <currentCommitSha> with the commit SHA from the first command and <mergeBase> with the merge-base SHA from the second.
This will:
removed_types.json.Example output:
❌ The following SO types are no longer registered: 'my-removed-type'.
Updated 'removed_types.json' to prevent the same names from being reused in the future.
Commit both your code changes and the updated removed_types.json.
To update removed_types.json by hand:
packages/kbn-check-saved-objects-cli/removed_types.json.::::{warning}
Once a type name is in removed_types.json, it cannot be used again for a new Saved Object type. Choose type names carefully when creating new types.
::::
Before removing a type: