---
title: "Lock selected content"
description: "Let users select content and mark it as locked so that it cannot be edited."
canonical_url: "https://tiptap.dev/docs/composable-docs/content-protection/guides/lock-selected-content"
---

# Lock selected content

Let users select content and mark it as locked so that it cannot be edited.

To let users select arbitrary content and lock it:

1. Define a [custom Mark or Node](https://tiptap.dev/docs/editor/extensions/custom-extensions/create-new.md) in your schema. Add an editor command that applies it to the selection.
2. Define a [protection rule](https://tiptap.dev/docs/composable-docs/content-protection/api-reference/policy.md) that selects content with that Mark or Node and sets the permission to `edit: false` so that its content cannot be edited. Use `target: 'mark'` to protect the marked content and its Mark, or `target: 'node'` to protect the Node, its attributes and all its content.
