tree data NEW lyd_unlink_meta_single()
diff --git a/src/tree_data.c b/src/tree_data.c
index 0e17384..59b44d8 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1020,6 +1020,28 @@
     }
 }
 
+void
+lyd_unlink_meta_single(struct lyd_meta *meta)
+{
+    struct lyd_meta *iter;
+
+    if (!meta) {
+        return;
+    }
+
+    if (meta->parent && (meta->parent->meta == meta)) {
+        meta->parent->meta = meta->next;
+    } else if (meta->parent) {
+        for (iter = meta->parent->meta; iter->next && (iter->next != meta); iter = iter->next) {}
+        if (iter->next) {
+            iter->next = meta->next;
+        }
+    }
+
+    meta->next = NULL;
+    meta->parent = NULL;
+}
+
 /**
  * @brief Get the annotation definition in the module.
  *
diff --git a/src/tree_data_internal.h b/src/tree_data_internal.h
index 72536bc..5168101 100644
--- a/src/tree_data_internal.h
+++ b/src/tree_data_internal.h
@@ -414,6 +414,13 @@
 void lyd_insert_meta(struct lyd_node *parent, struct lyd_meta *meta, ly_bool clear_dflt);
 
 /**
+ * @brief Unlink a single metadata instance.
+ *
+ * @param[in] meta Metadata to unlink.
+ */
+void lyd_unlink_meta_single(struct lyd_meta *meta);
+
+/**
  * @brief Create and insert a metadata (last) into a parent.
  *
  * @param[in] parent Parent of the metadata, can be NULL.