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

> This page is for Tiptap 2.x. [See the latest version of this page.](https://tiptap.dev/docs/editor/api/commands/selection/delete-selection.md)

# 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()
```
