
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeThe error you're seeing is a known issue with the @sanity/document-internationalization plugin. The plugin creates strong references between translated documents by default, and Sanity's API prevents deletion of documents that have strong references pointing to them to maintain referential integrity.
The plugin provides a built-in DeleteTranslationAction document action specifically designed to handle this. This action removes the translation reference before deleting the document, which is the recommended approach.
To use it:
DeleteTranslationAction is enabled in your Studio configuration (it should be by default)If you want to prevent this issue going forward, you can configure the plugin to use weak references instead of strong references. Add this to your plugin configuration:
documentInternationalization({
supportedLanguages: [
{ id: "en", title: "English" },
{ id: "es", title: "Spanish" }
],
schemaTypes: ["yourDocumentType"],
weakReferences: true // Defaults to false
})Important: This setting only affects newly created translation relationships. For existing documents with strong references, you'll still need to use the DeleteTranslationAction or manually remove the references.
The sanity documents delete CLI command doesn't automatically handle the translation reference cleanup, which is why it gave you the same error. The DeleteTranslationAction in Studio is specifically designed to handle this workflow.
If you need to delete documents programmatically or the DeleteTranslationAction isn't available, you'll need to:
ElLnRMEzVGBvCslc1mXoT)ElLnRMEzVGBvCslc1mXoT__i18n_es)You can do this via the API or by editing the document in Studio to remove the translation metadata field before deletion.
The weakReferences: true configuration is the best long-term solution to avoid this issue, but for your immediate problem with existing documents, use the DeleteTranslationAction provided by the plugin in Studio.
Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store