---
title: metafieldDefinitionDelete - Shop Partners API
description: Remove a MetafieldDefinition and cascade delete all associated Metafields.
api_version: unstable latest
source_url:
  html: https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionDelete
  md: https://shopify.dev/docs/api/shop-partners/latest/mutations/metafieldDefinitionDelete.md
---

# metafield​Definition​Delete

mutation

Remove a MetafieldDefinition and cascade delete all associated Metafields.

## Arguments

* identifier

  [Custom​Data​Key​Pair​Input!](https://shopify.dev/docs/api/shop-partners/latest/input-objects/CustomDataKeyPairInput)

  required

  This argument accepts an object that consists of a `key` and an optional `namespace`. The `key` is a mandatory attribute that represents a specific element within a namespace. The `namespace` attribute, if provided, should be a period-delimited string representing the hierarchical path to the desired definition. This is applicable in cases where the desired definition is nested within namespaces. In the absence of a provided `namespace`, the system will default to the client's implicit, reserved namespace.

***

## Metafield​Definition​Delete​Payload returns

* deleted​Definition

  [Metafield​Definition](https://shopify.dev/docs/api/shop-partners/latest/objects/MetafieldDefinition)

* user​Errors

  [\[User​Error!\]!](https://shopify.dev/docs/api/shop-partners/latest/objects/UserError)

  non-null

  List of errors that occured while executing the mutation.

***

## Examples

* ### metafieldDefinitionDelete reference