---
title: "deleteSelection command"
description: "The deleteSelection command in Tiptap targets and removes any nodes or content that are currently selected within the editor."
canonical_url: "https://tiptap.dev/docs/editor/api/commands/selection/delete-selection"
---

# deleteSelection command

The deleteSelection command in Tiptap targets and removes any nodes or content that are currently selected within the editor.

The `deleteSelection` command deletes the currently selected nodes. If no selection exists, nothing will be deleted.

## Use the deleteSelection command

```js
editor.commands.deleteSelection()
```
