# Comment Deletion

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2FEiPdTJMV5qJBvjJnfsDR%2Fdlxplugins-1677186573271-1x.webp?alt=media&#x26;token=3fa99f95-5853-47a3-a7d7-027bf072e741" alt=""><figcaption><p>Comment Deletion Options</p></figcaption></figure>

Sometimes comments are left in haste or in the moment, and the user would simply like to remove the comment rather than edit it. Allowing users to delete their comments is a nice way of self-policing their comments.

## Enabling Comment Deletion

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2F1Wzb6VXduPNbVLovWTiN%2Fdlxplugins-1677186816986-1x.webp?alt=media&#x26;token=fc592973-fe54-4786-86d9-98a8dcc02630" alt=""><figcaption><p>Allow Comment Deletion Option</p></figcaption></figure>

{% hint style="info" %}
Comment deletion is enabled by default
{% endhint %}

When a user edits a comment, they will see a button allowing them to delete their own comment.

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2Fug9wvGNjMdlu1UGeMJJk%2Fdlxplugins-1677186936352-1x.webp?alt=media&#x26;token=5a1821eb-fdbb-47e8-904b-642a9f1a1d58" alt=""><figcaption><p>Comment with Delete Button</p></figcaption></figure>

When a user chooses to delete their own comment, a confirmation is shown.

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2FsJuWKSyn82na2Dlyq6ET%2Fdlxplugins-1677186949934-1x.webp?alt=media&#x26;token=5976c0d0-7338-43a4-a782-31830246fea6" alt=""><figcaption><p>Prompt to Delete a Comment</p></figcaption></figure>

### Delete Only Option

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2FwbgL4SY83kwEh798w1bW%2Fdlxplugins-1677186976831-1x.webp?alt=media&#x26;token=105fc033-421f-4743-a8d0-02cee8bf4ff7" alt=""><figcaption><p>Allow "Delete Only" Option</p></figcaption></figure>

The "Delete Only" option is designed to only show the Delete option when editing a comment. The Edit button isn't visible, but a Delete option instead.

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2Fj6bm8T8bRsLlwA7Pw73t%2Fdlxplugins-1677186961547-1x.webp?alt=media&#x26;token=832c5bcf-8d58-41ad-8dc7-32588ddde552" alt=""><figcaption><p>Delete Comment Button on the Frontend</p></figcaption></figure>

## Removing the Confirmation

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2FNCVR8UnLNUw3ButumlFg%2Fdlxplugins-1677186993695-1x.webp?alt=media&#x26;token=166e2779-c2e3-4b70-a6af-5c9abebbcf48" alt=""><figcaption><p>Hide the Delete Button Confirmation Option</p></figcaption></figure>

When editing their comment, the Delete button is shown.

By default, a confirmation is shown to the user to prevent accidental clicks.

<figure><img src="https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2FjTvqOvb0SHF1i3HSU0gz%2Fdlxplugins-1677186949934-1x.webp?alt=media&#x26;token=ce0f9b1c-6bac-42a8-9735-94c54c477398" alt=""><figcaption><p>Delete This Comment Confirmation</p></figcaption></figure>

You can disable or enable this confirmation by toggling the setting.

## Delete Comments Demo

Here is the behavior of a user deleting a comment.

![Animated GIF of a User Deleting a Comment](https://3862281288-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FwIGhykuGfv38YJ8fAMWe%2Fuploads%2Fz6jXI4hVGdxAGkTiJfP5%2Fcomment-deletion.gif?alt=media\&token=c3e68175-5d83-4dc2-8216-03c8d898af86)

As you can see, when a user deletes a comment, a status update shows and the comment is removed from view.
